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

sin(1) works but sin.([1]) throws an InexactError #16960

Closed
ararslan opened this issue Jun 16, 2016 · 2 comments
Closed

sin(1) works but sin.([1]) throws an InexactError #16960

ararslan opened this issue Jun 16, 2016 · 2 comments

Comments

@ararslan
Copy link
Member

Current (as of this writing) master:

julia> sin(1)
0.8414709848078965

julia> sin.([1])
ERROR: InexactError()
 in macro expansion at ./broadcast.jl:97 [inlined]
 in macro expansion at ./simdloop.jl:73 [inlined]
 in macro expansion at ./broadcast.jl:91 [inlined]
 in _broadcast!(::Base.#sin, ::Array{Int64,1}, ::Tuple{Tuple{Bool}}, ::Tuple{Array{Int64,1}}, ::Type{Val{1}}) at ./broadcast.jl:86
 in broadcast! at ./broadcast.jl:139 [inlined]
 in broadcast(::Function, ::Array{Int64,1}) at ./broadcast.jl:143
 in eval(::Module, ::Any) at ./boot.jl:231
 in macro expansion at ./REPL.jl:92 [inlined]
 in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:46

I would have expected this to work as map does:

julia> map(sin, [1])
1-element Array{Float64,1}:
 0.841471

Any idea why this is happening?

@fcard
Copy link
Contributor

fcard commented Jun 16, 2016

That's good ol' #4883!

@ararslan
Copy link
Member Author

Ah yeah, I hadn't seen that conversation. Thanks, @fcard. I suppose I should close as a duplicate of #4883.

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