Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous BigDecimal operations #1633

nmk opened this Issue Apr 15, 2014 · 1 comment


None yet
3 participants
Copy link

nmk commented Apr 15, 2014

This is related to #1441.

BigDecimal#* and BigDecimal#mult differ in behaviour from MRI when passed nil as argument and BigDecimal#div throws a NullPointerException when the first argument is nil:

jruby-1.7.11 :011 >"10") * nil
 => nil
jruby-1.7.11 :012 >"10").mult(nil, 3)
 => nil
jruby-1.7.11 :013 >"10").div(nil, 3)
        from org.jruby.ext.bigdecimal.RubyBigDecimal.op_div19(
        from org.jruby.ext.bigdecimal.RubyBigDecimal$INVOKER$i$$INVOKER$i$op_div19.gen)
        from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(
        from org.jruby.ast.CallTwoArgNode.interpret(
        from org.jruby.ast.NewlineNode.interpret(
        from org.jruby.ast.RootNode.interpret(
        from org.jruby.evaluator.ASTInterpreter.INTERPRET_EVAL(
        from org.jruby.evaluator.ASTInterpreter.evalWithBinding(
        from org.jruby.RubyKernel.evalCommon(
        from org.jruby.RubyKernel.eval19(
        from org.jruby.RubyKernel$INVOKER$s$0$3$$INVOKER$s$0$3$eval19.gen)
        from org.jruby.ast.FCallManyArgsNode.interpret(
        from org.jruby.ast.NewlineNode.interpret(
... 114 levels...
        from org.jruby.ast.BlockNode.interpret(
        from org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(
        from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(
        from Users.nmk.$_dot_rvm.rubies.jruby_minus_1_dot_7_dot_11.bin.irb.__file__(/Users/nmk/.rvm/rubies/jruby-1.7.11/bin/irb:13)
        from Users.nmk.$_dot_rvm.rubies.jruby_minus_1_dot_7_dot_11.bin.irb.load(/Users/nmk/.rvm/rubies/jruby-1.7.11/bin/irb)
        from org.jruby.Ruby.runScript(
        from org.jruby.Ruby.runScript(
        from org.jruby.Ruby.runNormally(
        from org.jruby.Ruby.runFromMain(
        from org.jruby.Main.doRunFromMain(
        from org.jruby.Main.internalRun(
        from org.jruby.Main.main(
jruby-1.7.11 :014 >

sh286 added a commit that referenced this issue Apr 20, 2014

sh286 added a commit that referenced this issue Apr 21, 2014

GH-1633 - Fixing issue created by the last commit.
BigDecimal operation were throwing a TypeError when the first argument is another BigDecimal.

This comment has been minimized.

Copy link

sh286 commented Apr 21, 2014

Fixed by #1648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.