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!


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.