Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sign(::Complex): make sign of complex zero respect signs of parts #14806

Merged
merged 1 commit into from
Feb 17, 2016

Conversation

StefanKarpinski
Copy link
Member

Inspired by #14621.

@StefanKarpinski
Copy link
Member Author

cc @jiahao, @andreasnoack, @stevengj

@jiahao
Copy link
Member

jiahao commented Feb 3, 2016

I did not realize that we defined signum for complex numbers.

This doesn't seem right to me (#10000 ?):

julia> sign(-0.0im) #+0.0-0.0im? 
-0.0 - 0.0im

julia> sign(-0.0-0.0im)
-0.0 - 0.0im

julia> sign(0.0-0.0im)
0.0 - 0.0im

Apparently, there are multiple extensions to complex numbers and we should document which one we implement (sgn(z) in Wikipedia's notation rather than csgn).

@StefanKarpinski
Copy link
Member Author

Since -0.0im === complex(-0.0,-0.0) you're probably not testing what you think you are here.

@jiahao
Copy link
Member

jiahao commented Feb 4, 2016

Oh, talk about subtle.

@jiahao
Copy link
Member

jiahao commented Feb 4, 2016

My issue is orthogonal to this PR. Otherwise lgtm

StefanKarpinski added a commit that referenced this pull request Feb 17, 2016
sign(::Complex): make sign of complex zero respect signs of parts
@StefanKarpinski StefanKarpinski merged commit c99b9f6 into master Feb 17, 2016
@StefanKarpinski StefanKarpinski deleted the sk/complexsign branch February 17, 2016 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants