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.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.