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

Home » Public Forums » archive » NaN's in TOTAL, etc.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
NaN's in TOTAL, etc. [message #29906] Fri, 22 March 2002 14:30
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
Has anyone noticed the following behavior?

IDL> x = findgen(3,3)
IDL> x[1,0] = !values.f_nan
IDL> x[2,*] = !values.f_nan
IDL> print, x
0.00000 NaN NaN
3.00000 4.00000 NaN
6.00000 7.00000 NaN
IDL> print, total(x, 2)
9.00000 NaN NaN
IDL> print, total(x, 2, /nan)
9.00000 11.0000 0.00000

^^^^^^^

Using /NAN, the sum of all NaN's is 0.0!

Wouldn't it make more sense if the result were NaN? At a minimum,
this makes /NAN far less useful.


Ken
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: rebin question
Next Topic: DIRECT GRAPHICS VS OBJECT GRAPHICS

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

Current Time: Wed Oct 08 11:00:14 PDT 2025

Total time taken to generate the page: 0.00387 seconds