You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently: new Complex(Infinity).equals(Infinity) === false.
For reference:
In JavaScript: Infinity === Infinity is true
In Matlab both Inf == Inf and (Inf + Inf*i) == (Inf + Inf*i) aretrue
In Wolfram 'Infinity == Infinityistrueand it refuses to answerComplexInfinity == ComplexInfinity`
The c++ standard complex library compares the real and imaginary parts of the number.
Comparing re and im is done here as well, but not in a == manner but comparing against a rounding-error ignoring small epsilon. And since Inf-Inf =Inf > eps it is currently false. We could either add a special infinity check here or we keep it like this. I mean it's a philosophical question and totally depends on how you see infinity. When you say there are infinitely many infinites, then the current behavior is right. If you see it as a symbol comparision then we should follow other implementations
Activity
infusion commentedon Jan 28, 2018
Comparing
reandimis done here as well, but not in a==manner but comparing against a rounding-error ignoring small epsilon. And sinceInf-Inf =Inf > epsit is currently false. We could either add a special infinity check here or we keep it like this. I mean it's a philosophical question and totally depends on how you see infinity. When you say there are infinitely many infinites, then the current behavior is right. If you see it as a symbol comparision then we should follow other implementations