Re: Philosophical Question about NAN [message #63759 is a reply to message #63742] |
Mon, 17 November 2008 07:54   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Nov 17, 9:58 am, David Fanning <n...@dfanning.com> wrote:
> Folks,
>
> I've had a couple of run-ins lately with NANs and I wonder
> why routines like TOTAL and MEAN don't have the NAN keyword
> set to 1 by default. Why does the user have to set it?
I agree with the sentiment but also note that always setting /NAN
incurs a non-trivial performance penalty, e.g.
IDL> a = randomn(seed,10000,2000)
IDL> t = systime(1) & b = total(a) & print,systime(1)-t
0.25451803
IDL> t = systime(1) & b = total(a,/nan) & print,systime(1)-t
0.35278893
I've thought at times that arrays should carry a hidden bit saying
whether or not they include NaN values, but this introduces other
overhead problems.
--Wayne
|
|
|