3 ms·
It is the same reason the floating point standard loves NaN, exceptional "invalid" values allow you to encode recognizable extra information for error codes or
by afiori 7y ago
It is the same reason the floating point standard loves NaN, exceptional "invalid" values allow you to encode recognizable extra information for error codes or error handling. It is bug prone, but also quite lightweight and flexible.