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
pro testarray
a = dblarr(2)
k = 1
for j = 0, 2 do begin
print, j
if j eq k then a[1] = -1
print, a
ind = where(a lt 0, /null)
print, ind
a[ind] = 0
print, a
endfor
end
When I run this (gdl -X -e testarray), the output is
which is not what I expect: the -1 should be changed to 0, and only show up once in the output.
If I change k to 2, similar incorrect behaviour happens. But if I change k to 0, the expected/correct behaviour happens (i.e., -1 shows up only once in the output).
If I remove the loop (and the j eq k condition), I also observe the correct behaviour.
I don't know if I'm missing something here, or whether this is an actual bug in GDL. (I am not able to test this behaviour with IDL.)
My set up is a Macbook Pro M1, Sonoma 14.6.1 (Darwin 23.6.0), running a self-installed GDL in the terminal (iTerm), with the GDL version given as GDL - GNU Data Language, Version v1.1-30-g35d32bbc.
The text was updated successfully, but these errors were encountered:
I have this simple procedure
When I run this (
gdl -X -e testarray
), the output iswhich is not what I expect: the -1 should be changed to 0, and only show up once in the output.
If I change
k
to 2, similar incorrect behaviour happens. But if I changek
to 0, the expected/correct behaviour happens (i.e., -1 shows up only once in the output).If I remove the loop (and the
j eq k
condition), I also observe the correct behaviour.I don't know if I'm missing something here, or whether this is an actual bug in GDL. (I am not able to test this behaviour with IDL.)
My set up is a Macbook Pro M1, Sonoma 14.6.1 (Darwin 23.6.0), running a self-installed GDL in the terminal (iTerm), with the GDL version given as GDL - GNU Data Language, Version v1.1-30-g35d32bbc.
The text was updated successfully, but these errors were encountered: