comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Cool and Bizzare error in IDL 5.2.1
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Cool and Bizzare error in IDL 5.2.1 [message #20392] Tue, 20 June 2000 00:00
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
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
[Message index]
 
Read Message
Previous Topic: Re: Cool and Bizzare error in IDL 5.2.1
Next Topic: Re: Image in postscript

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 00:01:06 PDT 2025

Total time taken to generate the page: 1.12154 seconds