Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

‎#define tau 6.2831853

If you haven't gotten around to it, today's a good day.



Wouldn't it be better to do

    #define M_TAU = (2.0*M_PI)
instead, so that it's clear that it's a math constant instead of a local variable? Also, I suspect that the math.h pi constant is accurate to more than 8 decimal places, so this way you don't lose precision.


Whatever is appropriate in your context. :)

What I really mean is this: use it. If you're a tauist, but tau isn't in your header file / constant library / whatever you use, today might be a good day to put it there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: