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

Home » Public Forums » archive » Re: mean() function
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: mean() function [message #46957 is a reply to message #46935] Sun, 15 January 2006 00:58 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:

> biocpu@yahoo.com writes:
>
>> The following looks very odd. Have any clues?
>>
>> IDL> y = fltarr(1008879)+35
>> IDL> id = where(y ne 35, cc)
>> IDL> print, cc
>> 0
>> ; so y is strictly 35.0 BUT
>> IDL> print, mean(y)
>> 35.5249
>>
>> IDL> print, mean(y(0:400000))
>> 35.0000
>
> Goodness! It is the 10th already and this is the first
> "The Sky is Falling" post of the year. I was beginning
> to wonder what was going on! :-)
>
> You might want to have a look at this:
>
> http://www.dfanning.com/math_tips/sky_is_falling.html
>
> Cheers,
>
> David

mean is not useable if it results in this

IDL> print,mean( make_array(500000,val=35,/float) )
35.0413
IDL> print,mean( make_array(400000,val=35,/float) )
35.0000

I prefer a slower routine if this is right.

no one would accept 1.0 + 1.0 result = 1.5

The article is good to understand why mean should not be resolved this way!

Does one have implemented the gnu's version?

cheers
Reimar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: reading a ninary file
Next Topic: mean() function

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

Current Time: Mon Dec 01 20:56:18 PST 2025

Total time taken to generate the page: 2.31992 seconds