On Mar 10, 11:50 am, Duncan Booth <[EMAIL PROTECTED]>
wrote:
> "Jack" <[EMAIL PROTECTED]> wrote:
> > This is a naive question:
>
> > "%u" % -3
>
> > I expect it to print 3. But it still print -3.
>
> Internally it uses the C runtime to format the number, but if the number
> you ask it to print unsigned is negative it uses %d instead of %u. I have
> no idea if it is actually possibly to get a different output for %d versus
> %u.

%u used to be different from %d, but it changed because of the int/
long unification in Python 2.4.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to