jruby 9.1.6.0 (2.3.1) 2016-11-09 0150a76 Java HotSpot(TM) 64-Bit Server VM 25.111-b14 on 1.8.0_111-b14 +jit [linux-x86_64]
Linux frank-nb 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ ruby -e "require 'bigdecimal'; BigDecimal('1') / Float::NAN"
-e:1:in `to_r': NaN (FloatDomainError)
from -e:1:in `/'
from -e:1:in `<main>'
Actual Behavior
$ jruby -e "require 'bigdecimal'; BigDecimal('1') / Float::NAN"
Unhandled Java exception: java.lang.NumberFormatException
java.lang.NumberFormatException: null
<init> at java/math/BigDecimal.java:494
<init> at java/math/BigDecimal.java:383
<init> at java/math/BigDecimal.java:806
valueOf at java/math/BigDecimal.java:1274
getVpValueWithPrec19 at org/jruby/ext/bigdecimal/RubyBigDecimal.java:446
getVpValue19 at org/jruby/ext/bigdecimal/RubyBigDecimal.java:424
op_quo19_20 at org/jruby/ext/bigdecimal/RubyBigDecimal.java:1024
op_quo20 at org/jruby/ext/bigdecimal/RubyBigDecimal.java:1020
call at org/jruby/ext/bigdecimal/RubyBigDecimal$INVOKER$i$1$0$op_quo20.gen:-1
cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:338
call at org/jruby/runtime/callsite/CachingCallSite.java:163
invokeOther4:\=\| at -e:1
<main> at -e:1
invokeWithArguments at java/lang/invoke/MethodHandle.java:627
load at org/jruby/ir/Compiler.java:111
runScript at org/jruby/Ruby.java:846
runNormally at org/jruby/Ruby.java:761
runNormally at org/jruby/Ruby.java:779
runFromMain at org/jruby/Ruby.java:592
doRunFromMain at org/jruby/Main.java:425
internalRun at org/jruby/Main.java:313
run at org/jruby/Main.java:242
main at org/jruby/Main.java:204
The text was updated successfully, but these errors were encountered:
sumitmah
pushed a commit
to sumitmah/jruby
that referenced
this issue
Jan 4, 2017
@seamusabshere Looks like you're working on a patch? I've ported little bits of this logic from C Ruby...it's not too hard. Main challenge is figuring out where the Ruby-specific logic ends and the BigDecimal logic begins.
Environment
Expected Behavior
MRI ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
Actual Behavior
The text was updated successfully, but these errors were encountered: