Issue #3964 has been updated by Yuki Sonoda.

Status changed from Assigned to Closed

Not reproducible at ruby_1_9_2.
----------------------------------------
Backport #3964: Wrong length of sprintf("%020a",1)
http://redmine.ruby-lang.org/issues/3964

Author: Heesob Park
Status: Closed
Priority: Normal
Assignee: Yuki Sonoda
Category: 
Target version: 
ruby -v: ruby 1.9.3dev (2010-10-19 trunk 29531) [i386-mswin32_90]


=begin
 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
=end



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