Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Unpacking extended-double precision floats

by Fengor (Pilgrim)
on Nov 29, 2006 at 17:39 UTC ( #586755=note: print w/ replies, xml ) Need Help??


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
Re^2: Unpacking extended-double precision floats
by herveus (Parson) 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"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://586755]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-11-27 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (184 votes), past polls