in reply to Re: Network IEEE 754 to Native Floats: which pack/unpack ops better?
in thread Network IEEE 754 to Native Floats: which pack/unpack ops better?

There are at least two assumptions in my problem description regarding bit length.   First is that the native floating point format is indeed IEEE 754 conformant.   If so, a single-precision IEEE 754 value is 32 bits and the 'f' op will eat 4 bytes.   The second assumption, however, is a bit more uncertain.   While the 'L' op is defined as 32 bits, the 'N' op is defined as simply "an unsigned long".   Oh, wait, does the comment in perlfunc,
(These 'shorts' and 'longs' are _exactly_ 16 bits and _exactly_ 32 bits, respectively.)
apply to all four of the ops n, N, v, V grouped together?   (doh!)   Then we're good throughout using 32 bits (4 bytes), as long as everybody uses the IEEE format.

Thank you very much for testing on an other-endian system.   I so easily get cross-eyed with pack/unpack - it's nice to know sometimes I do get it!

  • Comment on Re: Re: Network IEEE 754 to Native Floats: which pack/unpack ops better?