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

Fixed parenthesis error #15003

Merged
merged 2 commits into from
Feb 9, 2016
Merged

Conversation

marsue
Copy link

@marsue marsue commented Feb 9, 2016

No description provided.

@StefanKarpinski
Copy link
Member

Since both of these evaluate to the same (correct) value, it's unclear to me that this was an error:

julia> -(3/4*im)
-0.0 - 0.75im

julia> -(3/4)*im
-0.0 - 0.75im

@yuyichao
Copy link
Contributor

yuyichao commented Feb 9, 2016

Isn't there some extra/missing minus signs going on here?

@yuyichao
Copy link
Contributor

yuyichao commented Feb 9, 2016

NVM, it is correct.

@marsue
Copy link
Author

marsue commented Feb 9, 2016

I didn't notice the precence of the *-operator, because the text is about the literal coefficient and the division.
Sorry my fault.

@marsue
Copy link
Author

marsue commented Feb 9, 2016

Leave the *-operator out would make the example more clear to me:
3/4im == 3/(4im) == -(3/4)im
But -(3/4)im evaluates to negative zero in the real part, whereas the other expressions have a positive zero…

@marsue
Copy link
Author

marsue commented Feb 9, 2016

I updated the patch.
Since the following equation is better, since it the focus is on the literal coefficient and the division operator and the priority of the multiplication is removed.

3/4im == 3/(4im) == -(3/4)im

I had read the previous equation (in a mathematical sense) as 3/4im == -(3/4im) which seemed to be an error to me.

@jiahao
Copy link
Member

jiahao commented Feb 9, 2016

But -(3/4)im evaluates to negative zero in the real part, whereas the other expressions have a positive zero…

#10000

At this point this PR is just a cosmetic change which I don't think conveys significant value. However, some additional wording about paying attention to the parentheses in the expression would make a useful contribution.

@StefanKarpinski
Copy link
Member

It seems a bit clearer, let's just merge it.

StefanKarpinski added a commit that referenced this pull request Feb 9, 2016
@StefanKarpinski StefanKarpinski merged commit d2a82a0 into JuliaLang:release-0.4 Feb 9, 2016
@tkelman
Copy link
Contributor

tkelman commented Feb 9, 2016

Note that this was against the release branch. It's generally preferable to open PR's against master first.

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.

5 participants