in reply to Re^6: Why is pack("N",42949672965) giving me 00 00 00 05
in thread Why is pack("N",42949672965) giving me 00 00 00 05
pack takes a bunch of bits and interprets them in whatever way you tell if to
That's what unpack does, as you demonstrated. pack, on the other hand, is very specific about what it takes.
Passing negative numbers where an unsigned one is expected currently performs a C cast, but it's undocumented behaviour.
Neither I nor Perl can see any difference
To see the difference between using 0xFFFF_FFFF and -1, you just had to substitute 0xFFFF_FFFF for -1 instead of writing an entirely new program. Try again.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Why is pack("N",42949672965) giving me 00 00 00 05
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 |