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

findall throws error for zero-step range #100

Closed
hyrodium opened this issue Apr 4, 2022 · 0 comments · Fixed by #111
Closed

findall throws error for zero-step range #100

hyrodium opened this issue Apr 4, 2022 · 0 comments · Fixed by #111

Comments

@hyrodium
Copy link
Collaborator

hyrodium commented Apr 4, 2022

julia> r = range(1,1,10)
StepRangeLen(1.0, 0.0, 10)

julia> findall(in(1..3),r)
ERROR: InexactError: trunc(Int64, NaN)
Stacktrace:
 [1] trunc
   @ ./float.jl:805 [inlined]
 [2] round
   @ ./float.jl:369 [inlined]
 [3] findall(interval_d::Base.Fix2{typeof(in), ClosedInterval{Int64}}, x::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64})
   @ IntervalSets ~/.julia/dev/IntervalSets/src/findall.jl:58
 [4] top-level scope
   @ REPL[6]:1
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

Successfully merging a pull request may close this issue.

1 participant