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 fredrikj
Recipients fredrikj
Date 2008-03-25.23:25:35
SpamBayes Score 0.029785627
Marked as misclassified No
Message-id <1206487537.98.0.104101200523.issue2487@psf.upfronthosting.co.za>
In-reply-to
Content
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from math import ldexp
>>> from sys import maxint

>>> ldexp(1.234, maxint//2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: math range error

>>> ldexp(1.234, maxint)
0.0

>>> ldexp(1.234, -maxint)
0.0

>>> ldexp(1.234, -maxint-2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: long int too large to convert to int

The first and third cases seem right.

The second is clearly a bug.

In the fourth case, it would be more correct to return 0.0 than to raise
an exception IMHO.
History
Date User Action Args
2008-03-25 23:25:38fredrikjsetspambayes_score: 0.0297856 -> 0.029785627
recipients: + fredrikj
2008-03-25 23:25:38fredrikjsetspambayes_score: 0.0297856 -> 0.0297856
messageid: <1206487537.98.0.104101200523.issue2487@psf.upfronthosting.co.za>
2008-03-25 23:25:36fredrikjlinkissue2487 messages
2008-03-25 23:25:35fredrikjcreate