|
|
|
|
|
by kazinator
3400 days ago
|
|
> Any time you see a decimal floating-point constant with a nonzero fractional part that doesn't end in '5', you're looking at a bug. That's just silly. If you're writing some famous mathematical constant, the digits should match that constant, and not the requirements of the machine. (Except for the last one being rounded off.) Suppose we had a floating-point machine that gave us maximum 4 digits of decimal precision. I wouldn't define the PI constant as 3.145. That would just look like a typo to people who have PI memorized to half a dozen digits or more. I'd make it 3.14159 (or more) and let the darn compiler find the nearest approximation on the floating-point axis. |
|