in reply to Re: Re: H2 pack/unpack not working for negative numbers
in thread H2 pack/unpack not working for negative numbers
Before you can decide, or we can help you decide, which format specifier is the correct one to use, you will need to know how the information you are trying to unpack was packed.
For example, you mention an integer. An integer could be
There are other formats but these are the most common.
Add to this, the possibility that some machines pack binary values into words in different (byte) orders. So called litte-endian and big-endian and with the exception of 1) above, you can double each of those possibilities, which is why pack/unpack have so many format specifiers for "integers": N n V v S s C c.
Which you need to use could be any of these, but as a guess, s, n, & v seem the most likely candidates. H seems the least likely.
In other words. You need to supply more information:)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: H2 pack/unpack not working for negative numbers
by Anonymous Monk on Dec 10, 2003 at 23:44 UTC | |
by BrowserUk (Patriarch) on Dec 11, 2003 at 00:00 UTC |