in reply to Stumped by a pack/unpack problem
Update1:
The reason for the difference on MAC and PC is that the real numbers are in the native machine format only. For more information see perldoc -f pack and perldoc perlport.
Update2:
sorry, my first idea works just with unpack("H*", reverse pack("f", 440.0)) vs unpack("H*", pack("f", 440.0))
By the way on my PC pack("f", 440.0) is 00 00 DC 43.
and pack("N", unpack("l", pack("f", 440.0))) just returns 43 dc 00 00
And the fastest solution would be a XS implementation.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Stumped by a pack/unpack problem
by crenz (Priest) on Feb 22, 2005 at 08:14 UTC | |
by esskar (Deacon) on Feb 22, 2005 at 09:40 UTC | |
Re^2: Stumped by a pack/unpack problem
by jmcnamara (Monsignor) on Feb 23, 2005 at 11:54 UTC |
In Section
Seekers of Perl Wisdom