JuliaMath / JuliaMath/DoubleFloats.jl

Multiplication by -im has inconsistent imaginary part sign compared with floating point arithmetic

Open
#237 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
172
Forks
37
PR merge metrics
No merged PRs in 30d

Description

I found an inconsistency:
```julia
julia> -im * big(0.0-10.0im)
-10.0 - 0.0im

julia> -im * (0.0-10.0im)
-10.0 - 0.0im

julia> -im * ComplexDF64(0.0-10.0im) # has opposite imaginary sign
-10.0 + 0.0im
```
This causes the following to give different results:
```julia
julia> log( -im * (0.0-10.0im))
2.302585092994046 - 3.141592653589793im

julia> log(-im * ComplexDF64(0.0-10.0im))
2.30258509299404568401799145468437419 + 3.14159265358979323846264338327950588im
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.