New submission from Bobblehead:
>>> (-0)**.5
0.0
Should return -0.0
"Except that squareRoot(−0) shall be −0", IEEE 754-2008, Section 5.4.1
>>> 1/(-0.0)
Traceback (most recent call last):
File "", line 1, in
ZeroDivisionError: float division by zero
>>> 1/(0.0)
Traceback (most recent call last):
File "", line 1, in
ZeroDivisionError: float division by zero
Should return -inf, and inf respectively.
"For division, when the divisor is zero and the dividend is a finite non-zero
number, the sign of the infinity is the exclusive OR of the operands’ signs",
IEEE 754-2008, Section 7.3
--
components: Interpreter Core
messages: 298368
nosy: Bobblehead
priority: normal
severity: normal
status: open
title: Python not IEEE 754 float compliant for various zero results
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
___
Python tracker
<http://bugs.python.org/issue30933>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com