Bug #3964: Wrong length of sprintf("%020a",1)
http://redmine.ruby-lang.org/issues/show/3964

Author: Heesob Park
Status: Open, Priority: Normal
Category: core, Target version: 1.9.x
ruby -v: ruby 1.9.3dev (2010-10-19 trunk 29531) [i386-mswin32_90]

The Revision r29531 introduced a new bug.

>> sprintf("%020a",1)
=> "0x0000000000001p+0"
>> sprintf("%20a",1)
=> "            0x1p+0"
>> sprintf("%020a",-1)
=> "-0x00000000000001p+0"
>> sprintf("%20a",-1)
=> "             -0x1p+0"
>> sprintf("%20a",1).length
=> 18
>> sprintf("%020a",1).length
=> 18
>> sprintf("%020a",-1).length
=> 20
>> sprintf("%20a",-1).length
=> 20


----------------------------------------
http://redmine.ruby-lang.org