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

Julia negative Exponentiation conflicts with emitted llvm code [BUG] #33982

Closed
rahulghangas opened this issue Nov 29, 2019 · 4 comments
Closed

Comments

@rahulghangas
Copy link

rahulghangas commented Nov 29, 2019

3^(-5) gives a Float64 of value 0.004115226337448558

while

@code_llvm ^(3, -5) emits the following llvm code

;  @ intfuncs.jl:221 within `^'
define i64 @"julia_^_11097"(i64, i64) {
top:
  %2 = call i64 @julia_power_by_squaring_990(i64 %0, i64 %1)
  ret i64 %2
}

which indicates that the function has an integer return type.

The output of versioninfo() is as follows-

Julia Version 1.2.0
Commit c6da87ff4b (2019-08-20 00:03 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.6.0)
  CPU: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, broadwell)
Environment:
  JULIA_EDITOR = atom  -a
  JULIA_NUM_THREADS = 2
@yuyichao
Copy link
Contributor

Dup of #21014

@rahulghangas
Copy link
Author

Hi, sorry but I'm having trouble seeing how this is a duplicate of the aforementioned issue. Can you explain?

@yuyichao
Copy link
Contributor

The macro isn't showing you the correct function.

@rahulghangas
Copy link
Author

Right, Thanks

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

No branches or pull requests

2 participants