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
I remember that you had requested change to Base to allow ranges to work correctly, I don't remember if those happened or not. But I think these are unrelated. Here is an example where collect(range) is not even monotonic. The result is not always the same, suggesting this value is initialized. Also the behavior is different when the range is used in a comprehenision vs when used with the new vectorizing dot syntax.
julia> range =0u"mm":0.001u"mm":5.4167u"mm"0.0 mm:0.001 mm:5.416 mm
julia>collect(range)[end]
NaN mm #expected 5.416mm
julia> [r.val for r in range][end]
6.934269676051e-310#expected 5.416
julia>getval(q)=q.val
julia>getval.(range)[end]
5.416#expected 5.416
Here is an example where the range appears to end two value too soon.
julia>collect(0u"mm":0.001u"mm":5u"mm")[end]
4.998000000000004 mm #expected 5.0 mm
julia>length(0:0.001:5)-length(0u"mm":0.001u"mm":5u"mm")
2
The text was updated successfully, but these errors were encountered:
This has been fixed on master. It will work exactly as you expect on Julia 0.6 when that comes out, and it will use Ranges.jl automatically on Julia 0.5, which does a pretty good job given the constraints of 0.5. I'll keep the issue open until I tag a new release—I've been slow to do that since Julia 0.6 development seems to break Unitful with some regularity.
I remember that you had requested change to Base to allow ranges to work correctly, I don't remember if those happened or not. But I think these are unrelated. Here is an example where
collect(range)
is not even monotonic. The result is not always the same, suggesting this value is initialized. Also the behavior is different when the range is used in a comprehenision vs when used with the new vectorizing dot syntax.Here is an example where the range appears to end two value too soon.
The text was updated successfully, but these errors were encountered: