in reply to Difficulty restraining read function to 32 bits
$ perl -le'print $ARGV[0] & 0xFFFFFFFF' 1000000000 1000000000 $ perl -le'print $ARGV[0] & 0xFFFFFFFF' 10000000000 4294967295
Use a floating point operation.
Replace
$checksum = $checksum & 0xFFFFFFFF;
with
$checksum %= 2**32;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Difficulty restraining read function to 32 bits
by TeamViterbi (Novice) on Jul 15, 2009 at 23:48 UTC | |
by ikegami (Patriarch) on Jul 16, 2009 at 14:44 UTC |