logoalt Hacker News

lmmtoday at 8:24 AM1 replyview on HN

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.


Replies

WalterBrighttoday at 4:51 PM

The idea is to make errors obvious rather than subtle. A NaN output is far more obvious than a number that is 2% off.

show 1 reply