This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jerub
Recipients
Date 2005-02-28.05:10:29
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
We have experienced a problem recently when wanting to
render a large float as a string. Converting the float
to an int/long manuall was required. 

'%d' % f
throws an exception for all floats f, f >= 2**31

Expected output, shown with 'int()' and 'long()':
>>> '%d %d' % (long(float(2**31)), int(float(2**31)))
'2147483648 2147483648'

Non-Working Example.
>>> '%d' % float(2**31)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: int argument required

Tested on:
Python 2.3.4 (#1, Oct 26 2004, 16:42:40) 
Python 2.4.1a0 (#2, Feb  9 2005, 22:42:24)
History
Date User Action Args
2008-01-20 09:57:35adminlinkissue1153226 messages
2008-01-20 09:57:35admincreate