Skip to content

Commit

Permalink
Revert "Fix BigDecimal#* with a Float"
Browse files Browse the repository at this point in the history
This reverts commit 480a8e2.
  • Loading branch information
mrkn committed Dec 18, 2020
1 parent 480a8e2 commit 7860c5b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion ext/bigdecimal/bigdecimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ BigDecimal_mult(VALUE self, VALUE r)

GUARD_OBJ(a, GetVpValue(self, 1));
if (RB_TYPE_P(r, T_FLOAT)) {
b = GetVpValueWithPrec(r, DBL_DIG, 1);
b = GetVpValueWithPrec(r, DBL_DIG+1, 1);
}
else if (RB_TYPE_P(r, T_RATIONAL)) {
b = GetVpValueWithPrec(r, a->Prec*VpBaseFig(), 1);
Expand Down
6 changes: 0 additions & 6 deletions test/bigdecimal/test_bigdecimal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -860,12 +860,6 @@ def test_mult_with_float
assert_kind_of(BigDecimal, BigDecimal("3") * 1.5)
end

def test_mult_with_float_bug13331
assert_equal(BigDecimal(64.4, Float::DIG),
BigDecimal(1) * 64.4,
"[ruby-core:80234] [Bug #13331]")
end

def test_mult_with_rational
assert_kind_of(BigDecimal, BigDecimal("3") * 1.quo(3))
end
Expand Down

0 comments on commit 7860c5b

Please sign in to comment.