JuliaLang/julia — Issue #443: Reverse Ranges Unpredictable
Author: alexalemi
Created: 2012-02-22 15:05:10+00:00
State: open

I'm getting unexpected behavior when trying to count backwards.

julia> [1:10]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

julia> reverse(1:10)
10:-1:1

julia> [10:-1:1]
[60813384, 0, 0, 601479970816, 60813384, 0, 0, 605774938112, 60813384, 0]

julia> [10:-1:1]
[140733193388032, -1, 140737488355327, 35862800, 140733193388033, -1, 140737488355327, -1, 4294967295, -1]

julia> [10:-1:1]
[4294967295, -1, 140737488355327, -1, 4294967295, -1, 140737488355327, -1, 4294967295, -1]

julia> [10:-1:1]
[4294967295, -1, 140737488355327, -1, 4294967295, -1, 140737488355327, -1, 4294967295, -1]

julia> [10:-1:1]
[4294967295, -1, 140737488355327, 39109888, 140733193388032, -1, 140737488355327, 39109888 ... ]

julia> [10:-1:1]
[0, 313717161984, 60814968, 0, 0, 330897031168, 60814968, 0, 0, 348076900352]

julia> [10:-1:1]
[0, 519875592192, 60814968, 0, 0, 279357423616, 60814968, 0, 0, 283652390912]

julia> [10:-1:1]
[0, 562825265152, 60814968, 0, 0, 567120232448, 60814968, 0, 0, 571415199744]

julia> [10:-1:1]
[0, 614364872704, 60814968, 0, 0, 210637946880, 60814968, 0, 0, 489659826176]

julia> [10:-1:1]
[0, -1, 140737488355327, 39144576, 0, -1, 140737488355327, 35864336, 0, -1]

julia> [10:-1:1]
[66448256, 66449952, 66546464, 66548192, 66549760, 66551488, 66553152, 66554912, 66556672, 66558464]