-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
breakingThis change will break codeThis change will break codecomplexComplex numbersComplex numbersneeds decisionA decision on this change is neededA decision on this change is needed
Milestone
Description
Dividing a nonzero value by 0 should give an infinite result. This works fine for floating point numbers, but not for complex:
julia> 1. / 0.
Inf
julia> 1. / (0.+0.im)
NaN + NaN*im
Similarly, dividing by infinity (with a finite numerator) should give 0. This isn't working entirely properly:
julia> 1/Inf
0.0
julia> 1/(Inf*im)
0.0 - 0.0im
julia> 1/(Inf + 0*im)
0.0 - 0.0im
julia> 1/(Inf + Inf*im)
NaN + NaN*im # this is wrong
Finally, in my opinion, there should be only a single ComplexInf
value and not allow this:
julia> a = 3+Inf*im
3.0 + Inf*im
julia> b = 4+Inf*im
4.0 + Inf*im
julia> a==b
false
Both a
and b
should have evaluated to a common ComplexInf
value. (We may also need a ComplexNaN
.) Separate +Inf
and -Inf
is fine for Real
values.
ron-wolf
Metadata
Metadata
Assignees
Labels
breakingThis change will break codeThis change will break codecomplexComplex numbersComplex numbersneeds decisionA decision on this change is neededA decision on this change is needed