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.

classification
Title: math.log1p(-1.0) produces OverflowError; should be ValueError
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: benjamin.peterson, mark.dickinson
Priority: normal Keywords: patch

Created on 2010-07-07 10:10 by mark.dickinson, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
log1p_neg1.patch mark.dickinson, 2010-07-07 10:10
Messages (2)
msg109468 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-07-07 10:10
>>> from math import log1p
>>> log1p(-1.0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: math range error

This should be a ValueError instead.

(Thanks Benjamin for noticing this.)
msg109482 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-07-07 16:23
Fixed in py3k in r82626.  I'm going to leave this as a 'won't fix' for the maintenance branches, on the basis that the risk of breaking code by changing the exception type exceeds the benefit from the fix.
History
Date User Action Args
2022-04-11 14:57:03adminsetgithub: 53432
2010-07-07 16:23:19mark.dickinsonsetstatus: open -> closed
resolution: fixed
messages: + msg109482

stage: patch review -> resolved
2010-07-07 10:19:58mark.dickinsonsetstage: patch review
2010-07-07 10:10:30mark.dickinsoncreate