Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1.6
-
Fix Version/s: JRuby 1.2
-
Component/s: Extensions
-
Labels:None
-
Environment:HideUbuntu 8.10
$jruby --version
jruby 1.1.6 (ruby 1.8.6 patchlevel 114) (2008-12-17 rev 8388) [i386-java]
$ java -version
java version "1.6.0_0"
IcedTea6 1.3.1 (6b12-0ubuntu6) Runtime Environment (build 1.6.0_0-b12)
OpenJDK Server VM (build 1.6.0_0-b12, mixed mode)ShowUbuntu 8.10 $jruby --version jruby 1.1.6 (ruby 1.8.6 patchlevel 114) (2008-12-17 rev 8388) [i386-java] $ java -version java version "1.6.0_0" IcedTea6 1.3.1 (6b12-0ubuntu6) Runtime Environment (build 1.6.0_0-b12) OpenJDK Server VM (build 1.6.0_0-b12, mixed mode)
-
Number of attachments :
Description
http://fisheye.codehaus.org/browse/jruby/trunk/jruby/src/org/jruby/ext/ffi/Util.java
The floatValue method in the above class is restricting the range too much. Float.MIN_VALUE is the smallest positive value possible so all non-positive values will be rejected as well as NaN and +-infinity.
Possible solutions:
- Just cast double to float. This would have the side effect of converting doubles too big or too small (too negative) for a float to +infinity and -infinity respectively, but all values in range should work.
- Change the range to -Float.MAX_VALUE to Float.MAX_VALUE and add special cases for NaN and +-infinity.
Fixed in r8659