Should IDL throw a warning in this case? [message #76843] |
Wed, 06 July 2011 08:00 |
Fabzou
Messages: 76 Registered: November 2010
|
Member |
|
|
Hi IDLers,
Just a thought about the last 10 minutes I lost understanding why the
MEAN() function was computing wrong values:
IDL> print, !VERSION
{ x86_64 linux unix linux 7.1.1 Aug 21 2009 64 64}
IDL> tk = FLTARR(150,150,27,13, /NOZERO)
IDL> tc = tk - 273.15
IDL> print, min(tk-tc), max(tk-tc)
273.150 273.150
everything OK, until:
IDL> print, mean(tk-tc)
267.597
Oh my god, how is this even possible???? Am I getting crazy?
And then, after 5 minutes and a coffee break:
IDL> print, mean(tk-tc, /DOUBLE)
273.14999
Uf, thank god I'm not crazy.
My feeling would say: IDL should throw a warning when you are
manipulating too big numbers (in my case: too big arrays) with IDL
built-in functions.
However, you IDL experts may not think so. What would be the reasons for
not throwing a warning? Thanks!
Fabien
|
|
|