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

Home » Public Forums » archive » Re: Incorrect behavior of /NAN
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Incorrect behavior of /NAN [message #30021] Thu, 04 April 2002 11:38 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Jaco van Gorkom wrote:
>
> "Paul van Delst" <paul.vandelst@noaa.gov> wrote in message
> news:3CAC9914.B52D1669@noaa.gov...
>> Kenneth Bowman wrote:
>>> ....
>>> IDL> print, mean([a, a], /nan)
>>> NaN
>>
>> I think the last result *here* is wrong :o) Shouldn't it be 1.0? What is
> MEAN in this case
>> but:
>>
>> total([a,a],/NAN) / n_elements(non-nan values only)
>>
>> Both the numerator and denominator are 0.
>
> So you mean that 0 / 0 = 1.0 ? Or 0. / 0. = 1.0 ?
> In any case, IDL seems to disagree with you here: :-)
>
> IDL> print, 0./0.
> -NaN
> % Program caused arithmetic error: Floating illegal operand
>
> IDL> print, 0/0
> 0
> % Program caused arithmetic error: Integer divide by 0
>

Maybe a holistic division operator is required in these sorts of cases. :o)

paulv

--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Need help identifying left most zero bit
Next Topic: Interfacing the functions

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

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

Total time taken to generate the page: 0.00702 seconds