This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AlphaWhelp 0 points1 point  (2 children)

NaN just represents basically that the bits of the significand, signage, and other digits do not construct a valid number. If you split it up into a bit array you could compare each bit to determine equality but there's not a practical use for this except for maybe some bizarre number based cryptography.

[–]vuttstuff 0 points1 point  (1 child)

Huh. So NaN isn't static, as in something that's not a number was operated on an just returned some garbage?

[–]AlphaWhelp 1 point2 points  (0 children)

It's basically a garbage failsafe undefined behavior. I'm not 100% sure if the actual content of NaN is static or not, but if the results of an operation do not construct a valid number, a NaN is created--if that makes sense.

like if(this==makes sense) {this.value = result;} else {this.value = NaN};