News for hackers. Stuff that matters.
Re:The Secret Life of NaN by lmm on Monday April 27, 2026 @09:27PM (#47929466)
Yep. This is NaN as a billion dollar mistake all over again.
Re:The Secret Life of NaN by WalterBright on Tuesday April 28, 2026 @01:52AM (#47930832)
Unrecognized subtle errors in floating point calculations are worse problems.
Re:The Secret Life of NaN by lmm on Tuesday April 28, 2026 @04:24AM (#47931795)
Sure, 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 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.
Re:The Secret Life of NaN by WalterBright on Tuesday April 28, 2026 @12:51PM (#47937069)
The idea is to make errors obvious rather than subtle. A NaN output is far more obvious than a number that is 2% off.
Re:The Secret Life of NaN by lmm on Tuesday April 28, 2026 @02:57PM (#47938902)
A compilation failure is even more obvious.