http://qs321.pair.com?node_id=586755


in reply to Unpacking extended-double precision floats

A quick google turned this up for double precison format dunno about extended though
Floating point Numbers

For packing floating point numbers you have the choice between the pack codes f and d which pack into (or unpack from) single-precision or double-precision representation as it is provided by your system. (There is no such thing as a network representation for reals, so if you want to send your real numbers across computer boundaries, you'd better stick to ASCII representation, unless you're absolutely sure what's on the other end of the line.)
from pack

--
"WHAT CAN THE HARVEST HOPE FOR IF NOT THE CARE OF THE REAPER MAN"
-- Terry Pratchett, "Reaper Man"

  • Comment on Re: Unpacking extended-double precision floats

Replies are listed 'Best First'.
Re^2: Unpacking extended-double precision floats
by herveus (Prior) on Nov 29, 2006 at 17:51 UTC
    Howdy!

    Thanks for trying (and no, I'm not being snarky). That doesn't quite cover my situation.

    f is a 32-bit "single-precision" float.

    d is a 64-bit "double-precision" float.

    I'm dealing with 80-bit "extended-double-precision" floats.

    yours,
    Michael
      yeah after looking a bit deeper into it i figured as much. Hmm maybe since pack converts into double-precision representation as it is provided by your system it would be possible to fool perl into believing double precision would take 80 bytes instead of 64?

      I'm reading through the POD of the Config Module as i write this and found the variables d_dbl_digit and d_ldbl_digit to be interesting. but it seems the Config module only supplies readonly access to those variables :/

      --
      "WHAT CAN THE HARVEST HOPE FOR IF NOT THE CARE OF THE REAPER MAN"
      -- Terry Pratchett, "Reaper Man"