in reply to Re^5: Why is pack("N",42949672965) giving me 00 00 00 05
in thread Why is pack("N",42949672965) giving me 00 00 00 05
Aside from the fact that N is suppose to take an unsigned integer,
Hm. pack takes a bunch of bits and interprets them in whatever way you tell if to:
print unpack 'f', pack 'N', unpack 'N', pack 'f', 3.141592653589793238 +4626433832795;; 3.14159274101257
your very question demonstrates that -1 and 0xFFFF_FFFF pack differently
Que! Care to explain what you think you mean by that?
Neither I nor Perl can see any difference:
print pack('N', -1) eq pack('N', 0xffffffff) ? 'Same' : 'Different';; Same
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Why is pack("N",42949672965) giving me 00 00 00 05
by ikegami (Patriarch) on Feb 10, 2015 at 03:14 UTC | |
by BrowserUk (Patriarch) on Feb 10, 2015 at 04:23 UTC | |
by soonix (Chancellor) on Feb 10, 2015 at 07:42 UTC | |
by BrowserUk (Patriarch) on Feb 10, 2015 at 07:54 UTC |