in reply to Re^2: HEX to floating point
in thread HEX to floating point
First, you have a typo in your hex string: '00000034000031b110191403b8811bb1366e4' (the highlighted 1). Second, if you run this on AIX (as I figure from the presence of "AIX" in the shebang path), you most likely don't want the reverse stuff anyway, as AIX typically runs on big-endian hardware, which already matches the binary format of your numbers...
In other words, on AIX, this should work (actually it does — tried it):
my $raw = pack "H*", '00000034000031b10191403b8811bb1366e4'; print "$_\n" for unpack 'NNCCd', $raw;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: HEX to floating point
by Spooky (Beadle) on Jun 16, 2008 at 18:12 UTC | |
by almut (Canon) on Jun 16, 2008 at 18:20 UTC | |
by FunkyMonk (Bishop) on Jun 16, 2008 at 22:37 UTC | |
by Anonymous Monk on Jun 17, 2008 at 09:25 UTC | |
by FunkyMonk (Bishop) on Jun 17, 2008 at 10:34 UTC |