You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I multiply zero with a range: 0.0 .* (1:8000) in Julia v0.7, I get the folliowing error:
ERROR: InexactError:trunc(Int64, NaN)
Stacktrace:
[1] trunc at ./float.jl:693 [inlined]
[2] round at ./float.jl:359 [inlined]
[3] floatrange(::Type{Float64}, ::Int64, ::Int64, ::Int64, ::Int64) at ./twiceprecision.jl:361
[4] _range(::Float64, ::Float64, ::Nothing, ::Int64) at ./twiceprecision.jl:435
[5] #range#29 at ./range.jl:76 [inlined]
[6] #range at ./none:0 [inlined]
[7] broadcasted(::Base.Broadcast.DefaultArrayStyle{1}, ::typeof(*), ::Float64, ::UnitRange{Int64}) at ./broadcast.jl:977
[8] broadcasted(::Function, ::Float64, ::UnitRange{Int64}) at ./broadcast.jl:1141
[9] top-level scope at none:0
This did not happen in v0.6.
Julia Version 0.7.0
Commit a4cb80f3ed (2018-08-08 06:46 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Workaround for now is: 0.0 .* collect(1:8000)
BTW if 0 is a Int, it produces the following error:
julia>0.* (1:8000)
ERROR: ArgumentError: step cannot be zero
Stacktrace:
[1] steprange_last(::Int64, ::Int64, ::Int64) at ./range.jl:190
[2] Type at ./range.jl:180 [inlined]
[3] _rangestyle at ./range.jl:93 [inlined]
[4] _range at ./range.jl:91 [inlined]
[5] #range#29 at ./range.jl:76 [inlined]
[6] #range at ./none:0 [inlined]
[7] broadcasted(::Base.Broadcast.DefaultArrayStyle{1}, ::typeof(*), ::Int64, ::UnitRange{Int64}) at ./broadcast.jl:977
[8] broadcasted(::Function, ::Int64, ::UnitRange{Int64}) at ./broadcast.jl:1141
[9] top-level scope at none:0
The text was updated successfully, but these errors were encountered:
If I multiply zero with a range:
0.0 .* (1:8000)
in Julia v0.7, I get the folliowing error:This did not happen in v0.6.
Workaround for now is:
0.0 .* collect(1:8000)
BTW if 0 is a Int, it produces the following error:
The text was updated successfully, but these errors were encountered: