-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Unexpected return value of NaN when raising to power #5361
Comments
Well, that's no good. |
This doesn't happen on master anymore:
The third case seems to be a parse ambiguity:
This gets parsed as:
|
What version did you encounter this bug on? |
I haven't updated in a couple weeks ... |
julia> versioninfo()
Julia Version 0.3.0-prerelease+503
Commit cb64f5a* (2013-12-15 23:50 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.0.0)
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
LAPACK: libopenblas
LIBM: libopenlibm |
Maybe this was a very recent change:
|
Did an update just now julia> foo = 0.1; foo ^ .21
0.6165950018614822
julia> foo = -0.1; foo ^ .21
ERROR: DomainError
in ^ at math.jl:405
julia> -0.1 ^ .21
-0.6165950018614822 With this julia> versioninfo()
Julia Version 0.3.0-prerelease+925
Commit bf8c1a2* (2014-01-11 15:39 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.0.0)
CPU: Intel(R) Core(TM)2 Duo CPU P7350 @ 2.00GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
LAPACK: libopenblas
LIBM: libopenlibm |
I think that's the right behavior unless we want to change Julia's precedence rules. |
Yes, I think the current version is correct. Arguably the |
So when julia> foo = 0.1; foo ^ .21
0.6165950018614822
julia> foo = 0.1; -foo ^ .21
-0.6165950018614822
julia> foo = -0.1; foo ^ .21
ERROR: DomainError
in ^ at math.jl:405 |
Unary operators like |
The relevant issue is that |
It's very common to write things like |
Okay, I see this now. Thanks for the clarification. Sorry for the noise here. |
The text was updated successfully, but these errors were encountered: