mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 23:16:42 +02:00
* sprintf.c (BSD_vfprintf): wrong padding arround prefix and
floating point with %a. [ruby-dev:42403] Bug #3956 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d41305b393
commit
a7e8b12f96
3 changed files with 15 additions and 0 deletions
|
@ -204,6 +204,13 @@ class TestSprintf < Test::Unit::TestCase
|
|||
assert_equal("Inf", sprintf("%E", Float::INFINITY))
|
||||
assert_equal("NaN", sprintf("%e", Float::NAN))
|
||||
assert_equal("NaN", sprintf("%E", Float::NAN))
|
||||
|
||||
assert_equal(" -0x1p+0", sprintf("%10a", -1))
|
||||
assert_equal(" -0x1.8p+0", sprintf("%10a", -1.5))
|
||||
assert_equal(" -0x1.4p+0", sprintf("%10a", -1.25))
|
||||
assert_equal(" -0x1.2p+0", sprintf("%10a", -1.125))
|
||||
assert_equal(" -0x1.1p+0", sprintf("%10a", -1.0625))
|
||||
assert_equal("-0x1.05p+0", sprintf("%10a", -1.03125))
|
||||
end
|
||||
|
||||
BSIZ = 120
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue