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: inf*inf gives inf, but inf**2 gives overflow error
Type: behavior Stage:
Components: Versions: Python 3.0
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: mark.dickinson, ms
Priority: normal Keywords:

Created on 2008-06-27 20:44 by ms, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg68853 - (view) Author: Mike Speciner (ms) Date: 2008-06-27 20:44
Tried this on wintel 32-bit
(3.0b1 (r30b1:64403M, Jun 19 2008, 14:56:09) [MSC v.1500 32 bit (Intel)]
msg68858 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-06-27 21:40
This is a known problem, that's unlikely to change unless there's a 
serious overhaul of Python's floating point.

The warning at the end of the math module documentation should probably 
be taken to apply equally to all the built-in floating-point operations:

"""The math module consists mostly of thin wrappers around the platform 
C math library functions. Behavior in exceptional cases is loosely 
specified by the C standards, and Python inherits much of its math-
function error-reporting behavior from the platform C implementation. As 
a result, the specific exceptions raised in error cases (and even 
whether some arguments are considered to be exceptional at all) are not 
defined in any useful cross-platform or cross-release way. For example, 
whether math.log(0) returns -Inf or raises ValueError or OverflowError 
isn't defined, and in cases where math.log(0) raises OverflowError, 
math.log(0L) may raise ValueError instead."""

Or, as Tim Peters is fond of saying:

"""All Python behavior in the presence of infinities, NaNs, and signed 
zeroes is a platform-dependent accident, mostly inherited from that all 
C89 behavior in the presence of infinities, NaNs, and signed zeroes is a 
platform-dependent crapshoot."""
msg68890 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-06-28 17:38
Closing as 'won't fix'.
History
Date User Action Args
2022-04-11 14:56:35adminsetgithub: 47472
2020-11-07 02:41:55iritkatriellinkissue20543 superseder
2008-06-28 17:38:11mark.dickinsonsetstatus: open -> closed
resolution: wont fix
messages: + msg68890
2008-06-27 21:40:52mark.dickinsonsetnosy: + mark.dickinson
messages: + msg68858
2008-06-27 20:44:52mscreate