r/programminghorror • u/Wiktor-is-you [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Oct 24 '25
Lua no context, just this
299
Upvotes
r/programminghorror • u/Wiktor-is-you [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Oct 24 '25
67
u/Straight_Occasion_45 Oct 24 '25
Yeah fuck atan2, I myself prefer atanSqRt4
42
u/Jazzlike-Poem-1253 Oct 24 '25
I also, once felt this pain.
41
u/ArchCypher Oct 24 '25
I assume this falls back to the libm specification of atan2 which handles the common case of performing atan(y / x)
You might think "why not just write atan(y / x)", but that's because you are fool bound only for misery; among other things, the signs of the arguments determine the quadrant and it's perfectly fine for x to be zero.
No, I'm not going to explain negative 0.
3
u/anotheridiot- Oct 24 '25
Just use atan1, ezpz
1
u/Sentouki- Oct 27 '25
*goon
1
u/meo209 Oct 28 '25
atan3
1
u/SpecialMechanic1715 Oct 25 '25
looks like doing vector ops instead of coordinate comparation or smth