Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
lazulicurio
· 5y ago · 0 comments
Probably so if you bitcast a floating point value into a signed int it maintains the proper sign for comparisons.
Comments
[–]
dvt
5y ago
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.
[–]
saagarjha
5y ago
Yeah, but why have a signed NaN at all? It’s not like they have a defined ordering anyways…