Exactly, as other languages do. Only languages where types as Ints aren’t scalars, but objects/structs, can carry alternative values as Null, Nan and Inf in their structural value behind the scenes. If you can’t keep the value, you must report the error, not silently “transform its value” to something else.
Any garbage float, non zero, with the top 9 bits set is a NaN (if the payload value is zero, then it represents a -Infinity)). So any non-zero float as Int32 or 0xFF800000 is a NaN. As you can notice, a lot of higher value bits is set, whatever NaN value gets resulted by any calculation error setting those bits and ignoring the rest, it could be translated to a huge value. For 64bit doubles it’s 12 bits instead of 9. So if you set the top 13 bits as 1, you guarantee a NaN.
Yes, after getting an exception in some impossible calculation, ignoring the error, you get a NaN that you could do some trick to use that NaN as a value in an int resulting in a large value (maybe random depending on the platform) that you can’t trust.