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

Add test for sprintf with Infinity and NaN.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-04-01 06:44:30 +00:00
parent 7e3e79d083
commit 9b40cdfe8c

View file

@ -202,6 +202,10 @@ class TestSprintf < Test::Unit::TestCase
assert_equal("0x1p+10", sprintf("%a", 1024)) assert_equal("0x1p+10", sprintf("%a", 1024))
assert_equal("0x1.23456p+789", sprintf("%a", 3.704450999893983e+237)) assert_equal("0x1.23456p+789", sprintf("%a", 3.704450999893983e+237))
assert_equal("0x1p-1074", sprintf("%a", 4.9e-324)) assert_equal("0x1p-1074", sprintf("%a", 4.9e-324))
assert_equal("Inf", sprintf("%e", Float::INFINITY))
assert_equal("Inf", sprintf("%E", Float::INFINITY))
assert_equal("NaN", sprintf("%e", Float::NAN))
assert_equal("NaN", sprintf("%E", Float::NAN))
end end
BSIZ = 120 BSIZ = 120