K
Kero
Hi,
Receiving a binary 32-bits unsigned integer over a socket, I unpack it,
and later on pack to send back.
This works fine with ruby 1.8.0, but I got a RangeError stating the Bignum
is too big to be converted to `int'. We're talking high values here, the
one I saw where it went wrong was above 3 billion.
I would suggest adding a couple of checks to the testsuite:
- [MAXINT].pack("i") => should work
- [MAXINT+1].pack("i") => RangeError
and the same for unsigned flavours, shorts, longs, chars.
Bye,
Kero.
+--- Kero ----------------------- kero@chello@nl ---+
| all the meaningless and empty words I spoke |
| Promises -- The Cranberries |
+--- M38c --- http://httpd.chello.nl/k.vangelder ---+
Receiving a binary 32-bits unsigned integer over a socket, I unpack it,
and later on pack to send back.
This works fine with ruby 1.8.0, but I got a RangeError stating the Bignum
is too big to be converted to `int'. We're talking high values here, the
one I saw where it went wrong was above 3 billion.
I would suggest adding a couple of checks to the testsuite:
- [MAXINT].pack("i") => should work
- [MAXINT+1].pack("i") => RangeError
and the same for unsigned flavours, shorts, longs, chars.
Bye,
Kero.
+--- Kero ----------------------- kero@chello@nl ---+
| all the meaningless and empty words I spoke |
| Promises -- The Cranberries |
+--- M38c --- http://httpd.chello.nl/k.vangelder ---+