From: Florian Gross Date: 2007-07-16T14:23:11+09:00 Subject: Re: sprintf: Format specifier tokens aren't checked well enough On Jul 16, 5:57 am, Nobuyoshi Nakada wrote: > > big = -(2 ** 80 + 5) > > "%u" % big # => "-79226953588444722964369244155" > > "%.50u" % big # => > > "....................-79226953588444722964369244155" > > > "%+u" % big # => "-1208925819614629174706181" > > big.to_s # => "-1208925819614629174706181" > > I'm not sure if this is broken. Can you explain the results > what you expect? I'd expect negative bignums to produce results with at least two dots (no "-"!) and the real bits for "%u" and "%.20u". I'm OK with "%+u" producing the same as big.to_s. That way it would match the behaviour of "%u" and fixnums.