[ruby-core:68049] Question about Array#pack and bignums

From: Daniel Berger <djberg96@...>
Date: 2015-02-06 17:23:54 UTC
List: ruby-core #68049
Hi,

Between 1.8 and 1.9 it looks like there was a behavior change with
Array#pack and values that are too large for the directive in question. I
just wanted to make sure that this was expected behavior.

# For example:
[2**65].pack("I")

Ruby 1.8 raised a RangeError here, while Ruby 1.9 and later returns
"\x000\x000\x000\x00".

Is this deliberate?

Thanks,

Dan

In This Thread

Prev Next