← Back to context

Comment by remram

4 years ago

There are 13 bits that are unused in the NaN representation, so you can put data in there without impeding your ability to represent every floating point value.

For example, if you are designing a scripting language interpreter, you can make every value a floating point number and use some of the NaNs to represent pointers, booleans, etc.

See also http://wingolog.org/archives/2011/05/18/value-representation...