[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cool and Bizzare error in IDL 5.2.1



Actually this turned out to be just the reult of calling a function
with a keyword being sent in my reference and the same thing
being passed as a parameter (doh).  Ah, the perils
of recursion.  It was pretty cool anyway though.

-bob




R.G. Stockwell <stockwell@co-ra.comremove> wrote in message
0dN35.38$482.32405@den-news1.rmi.net">news:0dN35.38$482.32405@den-news1.rmi.net...
> Well, I've spent the last hour or so tracking down an error,
> and finally found the cuplrit. Check out the result of the following
> commands
>
> IDL> help,current_mean
> CURRENT_MEAN    DOUBLE    =       -1.0853418
> IDL> help,newmean
> CURRENT_MEAN    DOUBLE    =       -1.0853418
>
>
> I have two variables, current_mean and newmean. There are no pointers
> used, and the code is very straighforward (just iteratively calculating
the
> mean).
> Note how  IDL>help,newmean give the result of current_mean, is that weird
or
> what??
>
> The error is that when newmean was calculated, current mean was being
> modified.
> The code fragment that demonstrates this is:
>
>  print,'current mean: ',current_mean
>  newmean   =  (current_mean*npoints+newpoint)/(npoints+1)
>  print,'current mean: ',current_mean
>
> And the resulting output is:
> current mean:       -1.0853418
> current mean:      -0.13970473
>
>
> I'm not sure how I was able to do this, but if it's repeatable, I think I
> smell
> some obsfucated IDL code in my future!
>
> better get back to work, I just thought it was cool.  If any one can
explain
> this,
> I'd be interested to hear it. But I'm guessing it will be difficult to
> reproduce.
>
> Cheers,
> bob
>
>
>
>
>
>
>
>
>
>
>