-
Notifications
You must be signed in to change notification settings - Fork 9
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
trig functions are not type-stable for complex inputs #14
Comments
julia> sintau(convert(Int,1.0)) === zero(Int)
true
julia> sintau(convert(Float64,1.0)) === zero(Float64)
true
julia> sintau(convert(Complex,1.0)) === zero(Complex)
false |
Note: this may be helped by JuliaLang/julia#20268 |
I don't think this is an issue: julia> show(Base.return_types(sintau, Tuple{Complex{Float64}}))
Any[Complex{Float64}] In addition, in PR #19 I used |
Before going further, I'd like to make sure you're aware of the context of my role in this package. I am currently maintaining it due to my interest in both Julia and tau, and the original author's lack of availability to maintain the package. However, my experience programming Julia is rather superficial, so I probably won't be able to communicate with you via code snippets alone :) -- and I'll likely ask some silly questions, so bear with me. With that said, I must say I don't completely follow what you mean with your comment above. I'd appreciate if you could expand a bit. |
Ok, don't worry ;-) I don't know exactly what In addition, in the same PR I used everywhere In the end, I believe this issue can be closed, as it isn't an issue at all ;-) |
Thanks for the details! I had never really studied how Complex works at sufficient detail, which caused my confusion. I assumed it was a straightforward concrete type like To confirm that I got this right: the correct form of the Complex test in the second above would be julia> sintau(convert(Complex,1.0)) === zero(Complex{Float64})
true right? In any case, yes, let's close this. |
Exact! Indeed julia> zero(Complex)
0 + 0im
julia> typeof(ans)
Complex{Int64}
julia> sintau(one(Complex))
0.0 + 0.0im
julia> typeof(ans)
Complex{Float64} Thus, |
Came across this while working to improve test coverage:
The text was updated successfully, but these errors were encountered: