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

Int64 Ranges with negative steps expanded in arrays seem not to work on Darwin #469

Closed
robert-chiniquy opened this issue Feb 26, 2012 · 1 comment

Comments

@robert-chiniquy
Copy link
Contributor

julia> [50.0:-1.0:40.0]
[50.0, 49.0, 48.0, 47.0, 46.0, 45.0, 44.0, 43.0, 42.0, 41.0, 40.0]

julia> [50:-1:40]
[140518254067184, 140518254067256, 140518254067328, 140518254067400  ...  ]

julia> for i = 50:-1:40
       print(i)
       end
5049484746454443424140
julia> linspace(50,40,11)
[50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40]
julia> 

My build is up to the latest, all tests seem to pass, a few other people on IRC using macs had this same issue.

The above expansion of [50:-1:40] was done in a Julia runtime which had been up for a bit. If I restart the repl and evaluate it:

julia> [50:-1:40]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

So this looks to me like the array memory isn't being assigned to when steps are negative integers.

@robert-chiniquy
Copy link
Contributor Author

Sorry, looks like this is fixed in a newer commit. Thanks!

StefanKarpinski pushed a commit that referenced this issue Feb 8, 2018
KristofferC added a commit that referenced this issue Jul 6, 2018
(cherry picked from commit 642f5a5ee4c691066d03bf0a9673913a35a5ebd7)
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Oct 11, 2021
Keno pushed a commit that referenced this issue Oct 9, 2023
* always use QuoteNode in eval_code

* fix tests on older Julia versions

* bump patch version
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

1 participant