From: Charles Oliver Nutter Date: 2009-06-11T01:28:06+09:00 Subject: Re: [Security] Ruby 1.8.6-pl369 released On Wed, Jun 10, 2009 at 11:24 AM, Urabe Shyouhei wrote: > Charles Oliver Nutter wrote: >> ➔ ruby19 -rbigdecimal -e "p BigDecimal.new('5E6999999').to_i" >> >> >> I have not tested the patched 1.8.6/1.8.7 versions to see if to_i has >> this issue. >> >> I'll have fixes for both JRuby issues on master and jruby-1_3 branches shortly. > > Well to_f can shortcut such cases to generate Inf, but to_i should generate > large Bignums, so there may be difficulties to solve to_i slowness for those cases. 1.9.1 appears to produce Float::MAX or Float::MIN for exponents outside float range, not Inf. It seems like the possibility of it running forever trying to produce an impossibly large Bignum should be addressed in some similar way. - Charlie