I think it was a mistake to add one. Neither gmpy2.mpfr nor float types have it.
This produces funny results (seen while working on #793):
>>> import math, mpmath
>>> z = complex(mpmath.inf, +0.0); mpmath.fp.asin(z)
(1.5707963267948966+infj)
>>> z = complex(math.inf, +0.0); mpmath.fp.asin(z)
(1.5707963267948966+infj)
>>> z = complex(mpmath.inf, -0.0); mpmath.fp.asin(z) # WTF?
(1.5707963267948966+infj)
>>> z = complex(math.inf, -0.0); mpmath.fp.asin(z) # ok
(1.5707963267948966-infj)
This happens, because with using __complex__() dunder, the mpmath.inf coerced to complex(math.inf,0) and then imaginary component built by complex constructor as complex(math.inf,0).imag + (-0.0)=0.0-0.0=0.0.
I think it was a mistake to add one. Neither
gmpy2.mpfrnorfloattypes have it.This produces funny results (seen while working on #793):
This happens, because with using
__complex__()dunder, thempmath.infcoerced tocomplex(math.inf,0)and then imaginary component built by complex constructor ascomplex(math.inf,0).imag + (-0.0)=0.0-0.0=0.0.