Hacker News new | past | comments | ask | show | jobs | submit login

I thought that style was considered bad form in modern C/C++ (esp. the later, with `constexpr`). What's wrong with

    const PI: f64 = 3.14159265358979323846264338327950288;

?



What machine can represent all those decimal digits so precisely that the ending decimal digits ...0288 are exactly right and not ...0287 ?

I'll accept without looking it up that the statement is correct syntax in some language (it doesn't look like C++ to me).


See above. The constant is (a) not pi, and (b) not an exact decimal representation of any binary floating-point number.




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

Search: