[squeak-dev] Re: statistics: standard deviation
Nicolas Cellier
nicolas.cellier.aka.nice at gmail.com
Wed Dec 5 17:38:51 UTC 2012
2012/12/5 glenpaling <slp5591 at me.com>:
> I add these two methods to the math functions protocol of the Collections
> class:
>
> variance
>
> ^(self - self average) squared average
>
> and
>
> standardDeviation
>
> ^self variance sqrt.
>
> Be careful with large collections integers as these methods will invoke
> fraction arithmetic which is rather slow. In most cases it would be better
> to force floating point.
>
>
No, IMO the library shouldn't force anything but let the decision to the sender.
Such information has a place in documentation.
Nicolas
>
> --
> View this message in context: http://forum.world.st/statistics-standard-deviation-tp4655159p4658151.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
More information about the Squeak-dev
mailing list
|