32 ms·
Yep. This is NaN as a billion dollar mistake all over again.
by lmm 6mo ago
Yep. This is NaN as a billion dollar mistake all over again.
- WalterBright 6mo agoUnrecognized subtle errors in floating point calculations are worse problems.
- lmm 6mo agoSure, but that only matters if default-initialising to NaN significantly reduces them compared to the alternatives. IME it takes a very finely calibrated level of thoughtfulness for your argument in https://news.ycombinator.com/item?id=47928539 https://news.ycombinator.com/item?id=47928539 to work, to have a programmer who is simultaneously thoughtless enough to initialise to 0 without thinking if the compiler requires initialisation, but thoughtful enough to stop and think about it when the compiler initialises to NaN.
- WalterBright 6mo agoThe idea is to make errors obvious rather than subtle. A NaN output is far more obvious than a number that is 2% off.
- lmm 6mo agoA compilation failure is even more obvious.