mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vsnprintf.c (BSD_vfprintf): fix precision specifier doesn't
work well on %f. [ruby-dev:42552] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1f3e96b7ac
commit
599a7071c1
3 changed files with 8 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Nov 8 15:40:56 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* vsnprintf.c (BSD_vfprintf): fix precision specifier doesn't
|
||||
work well on %f. [ruby-dev:42552]
|
||||
|
||||
Mon Nov 8 14:41:40 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (get_wsa_extension_function): typos.
|
||||
|
|
|
@ -189,6 +189,7 @@ class TestSprintf < Test::Unit::TestCase
|
|||
assert_equal("36893488147419111424",
|
||||
sprintf("%20.0f", 36893488147419107329.0))
|
||||
assert_equal(" Inf", sprintf("% 0e", 1.0/0.0), "moved from btest/knownbug")
|
||||
assert_equal(" -0.", sprintf("%#10.0f", -0.5), "[ruby-dev:42552]")
|
||||
end
|
||||
|
||||
def test_float_hex
|
||||
|
|
|
@ -855,6 +855,8 @@ fp_begin: _double = va_arg(ap, double);
|
|||
size += prec + 1;
|
||||
} else if (!prec) { /* "0" */
|
||||
size = 1;
|
||||
if (flags & ALT)
|
||||
size += 1;
|
||||
} else /* "0.X" */
|
||||
size = prec + 2;
|
||||
} else if (expt >= ndig) { /* fixed g fmt */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue