Skip to content

Division of finite values by infinite complex values should always return zero #23134

@LordZorgoth

Description

@LordZorgoth

Since Issue 9790 was closed and it was mentioned that corner cases should be separate issues, I am reposting one particular element of that issue where Julia is currently both wrong and, according to a comment in the thread, inconsistent with C++.

Division of any finite value by any complex infinite value should return 0. Currently, we have the following behavior in Julia 0.6.0:

julia> 1/(Inf+im*Inf)
NaN + NaN*im

julia> 1/(Inf+im*NaN)
NaN + NaN*im

julia> 1/(Inf+0*im)
0.0 - 0.0im

The third case is correct, but both of the other two cases are mathematically wrong. The first case is wrong. The second case is also wrong because if NaN is replaced by some real value, or by Inf, or by -Inf, it is clear that the result should be zero in each case. Further, it is inconsistent with the behavior of C++.

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexComplex numbers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions