[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Mark Dickinson


Mark Dickinson  added the comment:

FWIW, I do consider this a bug, albeit a minor one. I may find time to fix it 
at some point (but it's fine to leave it closed until that time comes).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

One other thought.  The mental model for degrees() is just a simple scaling 
operation.  If done in pure Python, we would get *inf* rather than an 
OverflowError.  I don't see any value in breaking with the obvious substitution:

>>> sys.float_info.max * (180 / pi)
inf

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm not interested in having this move forward.  AFAICT it doesn't solve any 
known user problems (no one has cared about this before or since this issue was 
opened).  It slightly slows the code.  And it might break some existing code 
that wasn't previously a need to catch an OverflowError.

Marking this as closed.  If someone thinks this is really needed, feel free to 
reopen.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy -patch
type:  -> enhancement
versions: +Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2019-05-06 Thread anthony shaw


anthony shaw  added the comment:

Francisco, I recommend converting the patch into a GitHub pull request to make 
it easier to code review.

Mark, Raymond, please could you re-review this patch.

--
nosy: +anthonypjshaw, rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2016-10-27 Thread Mark Dickinson

Mark Dickinson added the comment:

Actually, here's a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file45244/math-degrees-overflow.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2016-10-27 Thread Mark Dickinson

Mark Dickinson added the comment:

Francisco: would you be interested in writing a patch?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2016-10-27 Thread Mark Dickinson

Mark Dickinson added the comment:

I agree in principle.

On one hand, it's difficult to care too much, since `math.degrees` is going to 
be all-but-useless for inputs larger than `1e20` or so anyway (the actual angle 
represented is getting lost in floating-point noise by that point).

OTOH, *because* of the above, at least making the change shouldn't break any 
code that wasn't broken already.

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2016-10-26 Thread Francisco Couzo

New submission from Francisco Couzo:

Most functions in the math library raise an OverflowError when the arguments 
are finite but the result is not.

>>> math.exp(sys.float_info.max)
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: math range error

>>> math.degrees(sys.float_info.max)
inf

--
messages: 279513
nosy: franciscouzo
priority: normal
severity: normal
status: open
title: math.degrees(sys.float_info.max) should throw an OverflowError exception

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com