print longs

Emile van Sebille emile at fenx.com
Tue Oct 5 06:37:08 EDT 1999


Did I miss something?

>>> print '%d' % 987654321987654321L
987654321987654321L
>>> print '%d' % 987654321987654321L
Traceback (innermost last):
  File "<pyshell#5>", line 1, in ?
    print '%d' % 987654321987654321L
OverflowError: long int too long to convert
>>>

--

Emile van Sebille
emile at fenx.com
-------------------


Clement <clement at ans.com.au> wrote in message
news:37F98517.DD12EF2F at ans.com.au...
> Try '%d'
>
> Greg Ewing wrote:
> >
> > Nathan Clegg wrote:
> > >
> > > Do I have to convert
> > > to a string and manually pull the 'L' off?
> >
> > Unfortunately, yes. Many other people think this
> > is a pain as well, but Guido doesn't seem to be
> > among them, so we're stuck with this for the time
> > being.
> >
> > Greg
>
> --
>
> Regards
>
> Clement






More information about the Python-list mailing list