1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_to_f): added

for previous commit.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2012-08-31 05:52:10 +00:00
parent 1d1130eea1
commit 15293df7d7
2 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Fri Aug 31 14:51:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_to_f): added
for previous commit.
Fri Aug 31 14:32:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): use self's sign to

View file

@ -569,6 +569,11 @@ class TestBigDecimal < Test::Unit::TestCase
assert_nothing_raised(FloatDomainError, x) {
assert_in_delta(0.0, BigDecimal(x).to_f, 10**Float::MIN_10_EXP, bug6944)
}
assert_equal( 0.0, BigDecimal( '9e-325').to_f)
assert_equal( 0.0, BigDecimal( '10e-325').to_f)
assert_equal(-0.0, BigDecimal( '-9e-325').to_f)
assert_equal(-0.0, BigDecimal('-10e-325').to_f)
end
def test_coerce