Skip to content

Commit

Permalink
In 1.9, BigDecimal("Infinity").div BigDecimal("1") raise FloatDomainE…
Browse files Browse the repository at this point in the history
…rror.
  • Loading branch information
BanzaiMan committed Nov 20, 2011
1 parent 3beab56 commit 5ae757d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion spec/tags/1.9/ruby/library/bigdecimal/div_tags.txt

This file was deleted.

4 changes: 4 additions & 0 deletions src/org/jruby/RubyBigDecimal.java
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,10 @@ public IRubyObject op_div19(ThreadContext context, IRubyObject other) {
throw context.getRuntime().newZeroDivisionError();
}

if (isInfinity()) {
throw context.getRuntime().newFloatDomainError("Computation results to 'Infinity'");
}

return op_div(context, other);
}

Expand Down

0 comments on commit 5ae757d

Please sign in to comment.