3 ms·
>This is specific to IEEE 754, not all binary representations have this issue. Also sometimes it is a feature. The payload of a NaN value can be user defined a
by josefx 7y ago
>This is specific to IEEE 754, not all binary representations have this issue.
Also sometimes it is a feature. The payload of a NaN value can be user defined and some programs use it[1]. The string "NaN" drops information that might be usefull to some programs, it just doesn't affect as many as null -> "null" does.
[1] https://github.com/WebKit/webkit/blob/master/Source/JavaScriptCore/runtime/PureNaN.h https://github.com/WebKit/webkit/blob/master/Source/JavaScri...