Hacker News new | ask | show | jobs
by lazulicurio 1749 days ago
Probably so if you bitcast a floating point value into a signed int it maintains the proper sign for comparisons.
2 comments

I think casting a NaN to an int will always just return gibberish, signed or not. In fact, this is explicitly undefined behavior in C.
Yeah, but why have a signed NaN at all? It’s not like they have a defined ordering anyways…