J
Jean-Claude Arbaut
Hi,
is there a limit on a Bignum size ?
I get this:
irb> a=2**262144; a % 10**20
=> 62605349934298300416
irb> a=2**262145; a
(irb):1: warning: in a**b, b may be too big
=> Infinity
But then,
irb(main):004:0> b=a+a; b % 10**20
=> 25210699868596600832
and even:
irb> c=a**31; c % 10**20
=> 54593967939561455616
The problem continues here:
irb> d=a**32; d % 10**20
(irb):21: warning: in a**b, b may be too big
(irb):21: warning: Bignum out of Float range
=> NaN
But I can compute this value anyway:
irb> e=c*a; e % 10**20
=> 85551374411818336256
Is there a bug in the ** method ?
is there a limit on a Bignum size ?
I get this:
irb> a=2**262144; a % 10**20
=> 62605349934298300416
irb> a=2**262145; a
(irb):1: warning: in a**b, b may be too big
=> Infinity
But then,
irb(main):004:0> b=a+a; b % 10**20
=> 25210699868596600832
and even:
irb> c=a**31; c % 10**20
=> 54593967939561455616
The problem continues here:
irb> d=a**32; d % 10**20
(irb):21: warning: in a**b, b may be too big
(irb):21: warning: Bignum out of Float range
=> NaN
But I can compute this value anyway:
irb> e=c*a; e % 10**20
=> 85551374411818336256
Is there a bug in the ** method ?