
Nov. 23, 2020
2:18 p.m.
On Tue, Nov 24, 2020 at 9:05 AM Steven D'Aprano <steve@pearwood.info> wrote:
On Mon, Nov 23, 2020 at 04:26:20PM -0500, Wes Turner wrote:
Is there a different IEEE spec or CAS that distinguishes between 1/x and 2/x where x=0?
No. x/0.0 would either signal an error (in Python terms: raise an exception) or return a NAN. The specific NAN it might return is not set by the IEEE-754 standard.
from numpy import float64 as f f(1)/f(0) <stdin>:1: RuntimeWarning: divide by zero encountered in double_scalars inf f(1)/-f(0) -inf
ChrisA