in reply to Converting binary to double precision

Your value comes from a big-endian system, so you'll need 'd>' to decode it:

$n = pack 'H16', '3f0df9673344c570';; print unpack 'd>', $n;; 5.71713084433029e-005

You could also do the byte swapping yourself:

$n = pack 'H16', '3f0df9673344c570';; print unpack 'd', scalar reverse $n;; 5.71713084433029e-005

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.

Replies are listed 'Best First'.
Re^2: Converting binary to double precision (big-endian)
by ahoriuch (Acolyte) on Feb 24, 2014 at 21:34 UTC

    In my case, this was the correct answer. I needed to switch from big to little-endian. It's amazing how little there is on the internet on this subject. Hopefully this will help future users.

    my $n = pack 'H16', '3f0df9673344c570';; printf "Big\n"; print unpack ("d", scalar reverse $n); #Big #5.71713084433029e-05 printf "\nLittle\n"; print unpack ("d",$n); printf "\n"; #Little #1.69044404965372e+235