Skip to content

Commit

Permalink
revert commit 9b8aa73
Browse files Browse the repository at this point in the history
it was a jruby-1_7 patch only
  • Loading branch information
mkristian committed Mar 20, 2015
1 parent 84562e1 commit 82ebb84
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
Expand Up @@ -520,10 +520,7 @@ private static RubyBigDecimal newInstance(ThreadContext context, IRubyObject rec

BigDecimal decimal;
try {
System.err.println("newInstance " + strValue );
System.err.println("newInstance " + mathContext );
decimal = new BigDecimal(strValue, mathContext);
System.err.println("newInstance " + decimal );
} catch (NumberFormatException e) {
if (isOverflowExceptionMode(context.runtime)) throw context.runtime.newFloatDomainError("exponent overflow");

Expand All @@ -548,9 +545,7 @@ public static RubyBigDecimal newInstance(ThreadContext context, IRubyObject recv

@JRubyMethod(name = "new", meta = true)
public static RubyBigDecimal newInstance(ThreadContext context, IRubyObject recv, IRubyObject arg, IRubyObject mathArg) {
System.err.println( "margs" + mathArg);
int digits = (int) mathArg.convertToInteger().getLongValue();
System.err.println( "margs" + digits);
if (digits < 0) throw context.runtime.newArgumentError("argument must be positive");

MathContext mathContext = new MathContext(digits);
Expand Down
8 changes: 1 addition & 7 deletions test/jruby/test_bignum.rb
@@ -1,5 +1,4 @@
require 'test/unit'
require 'bigdecimal'

class TestBignum < Test::Unit::TestCase
# others tested in FixnumBignumAutoconversion test
Expand Down Expand Up @@ -42,11 +41,6 @@ def test_bignum_should_respond_to_array_operator
def test_bignum_aref_with_bignum_arg_no_exception
assert_equal(0, (2**64)[2**32])
end

def test_GH_2650
assert_equal(BigDecimal.new("10.91231", 1).to_f, 10.91231)
assert_equal(BigDecimal.new("10.9", 2).to_f, 10.9)
end
# more to come

end
end

0 comments on commit 82ebb84

Please sign in to comment.