Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inf*inf gives inf, but inf**2 gives overflow error #47472

Closed
ms mannequin opened this issue Jun 27, 2008 · 3 comments
Closed

inf*inf gives inf, but inf**2 gives overflow error #47472

ms mannequin opened this issue Jun 27, 2008 · 3 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@ms
Copy link
Mannequin

ms mannequin commented Jun 27, 2008

BPO 3222
Nosy @mdickinson

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-06-28.17:38:11.141>
created_at = <Date 2008-06-27.20:44:52.431>
labels = ['type-bug']
title = 'inf*inf gives inf, but inf**2 gives overflow error'
updated_at = <Date 2008-06-28.17:38:11.140>
user = 'https://bugs.python.org/ms'

bugs.python.org fields:

activity = <Date 2008-06-28.17:38:11.140>
actor = 'mark.dickinson'
assignee = 'none'
closed = True
closed_date = <Date 2008-06-28.17:38:11.141>
closer = 'mark.dickinson'
components = []
creation = <Date 2008-06-27.20:44:52.431>
creator = 'ms'
dependencies = []
files = []
hgrepos = []
issue_num = 3222
keywords = []
message_count = 3.0
messages = ['68853', '68858', '68890']
nosy_count = 2.0
nosy_names = ['mark.dickinson', 'ms']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue3222'
versions = ['Python 3.0']

@ms
Copy link
Mannequin Author

ms mannequin commented Jun 27, 2008

Tried this on wintel 32-bit
(3.0b1 (r30b1:64403M, Jun 19 2008, 14:56:09) [MSC v.1500 32 bit (Intel)]

@ms ms mannequin added the type-bug An unexpected behavior, bug, or error label Jun 27, 2008
@mdickinson
Copy link
Member

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."""

@mdickinson
Copy link
Member

Closing as 'won't fix'.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant