in reply to NaN output
Are you sure that you are not encountering an endian problem? For example, the 4 byte value 0x7ff00000, decoded as a big-endian float produces a valid number:
print unpack 'f>', pack 'V', 0x7ff00000;; 8.6273742553086e-041
But treated as a little-endian value it produces NaN:
print unpack 'f<', pack 'V', 0x7ff00000;; 1.#QNAN
Just a thought.
|
|---|