3 ms·
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.1415926535897932384626
by kinghajj 10y ago
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;
?
- cardiffspaceman 10y agoWhat 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).
- pklausler 10y agoSee above. The constant is (a) not pi, and (b) not an exact decimal representation of any binary floating-point number.