-
Notifications
You must be signed in to change notification settings - Fork 205
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Milestone
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior