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:
parent
1d1130eea1
commit
15293df7d7
2 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue