2 ms·
POSIX defines M_PI, M_PI_2 and M_2_PI None of these is 2 * pi (M_PI_2 is pi / 2, and M_2_PI is 2 / pi) That is a shame because 2 * pi is commonly needed and h
by Aardwolf 5y ago
POSIX defines M_PI, M_PI_2 and M_2_PI
None of these is 2 * pi (M_PI_2 is pi / 2, and M_2_PI is 2 / pi)
That is a shame because 2 * pi is commonly needed and having it in 2 * M_PI form can cause mistakes such as order of operations if it's a divisor.
Since names M_2_PI and M_PI_2 are already taken, M_TAU would be very sensible.