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
|
|---|
| 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 |