On Sat, Dec 07, 2002 at 07:12:09PM -0500, Stephen wrote: > > Another math question... How would I find the mode (number that repeats most > often) of an array? Then, if there isn't a number that repeats most often, > tell the user that.
A while back, I wrote functions for mean, median and mode. I've put them up at http://www.it.ca/software/statsmmm.php . I don't much like the mode function -- it seems awkward, but I couldn't figure out how to write it any smaller. Also included is a function that calculates the 95th percentile of values in an array, roughly the same way the median() function works ... but I don't recommend using this for bandwidth calculations for co-lo customers because of the hassle of pulling all that data into an array. 95th percentile is more easily calculated in the SQL server than in php. -- Paul Chvostek <[EMAIL PROTECTED]> Operations / Abuse / Whatever +1 416 598-0000 it.canada - hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php