Basically, 2.2250738585072012e-308 in various forms can't be generated.
this is related to JRUBY-5190, the boundaries that make the to_f => 0.0 behavior circunvent the same infinite loop triggered by this big number
I made another attempt that tries to check if the value is in the proper range, but this version fails other specs that expect specific minimum float values.
Oracle has released a hotfix that applies to earlier JDKs as well. http://www.oracle.com/technetwork/java/javase/fpupdater-tool-readme-305936.html
I expect Apple will get updates released shortly.
Indeed, Apple's latest JDK contains the fix.
$ jruby -v -e 'p 2.2250738585072012e-308'
jruby 1.6.0 (ruby-1.8.7-p330) (2011-04-11 b695384) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_24) [darwin-x86_64-java]
We do still have a pragmatic problem of supporting older versions of JDK.
Should we incorporate the fix outlined here: http://extremestjython.blogspot.com/2011/02/no-more-java-double-trouble.html
Yes, I think we should.
Fixed on master (66b5b33) and jruby-1_6:
Author: Charles Oliver Nutter <email@example.com>
Date: Mon Jul 11 19:40:43 2011 -0500
Fix JRUBY-5541 on older JDKs: Attempt to create decimal 2.2250738585072012e-308 sends JVM into tight infinite loop