median

From RPTools Wiki
Revision as of 11:39, 13 December 2008 by Craig (talk | contribs) (New page: ==Function median== Returns the wp:Median of the numbers passed in. The median value is the value where half the numbers in the list are higher or equal to it and the other half are ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function median

Returns the Median of the numbers passed in. The median value is the value where half the numbers in the list are higher or equal to it and the other half are lower or equal to it. The median is calculated by sorting the list of numbers and picking the middle number if the list has an odd amount or averaging the two in the middle if there is an even amount.


Usage

[h: av = median(num, num, ...)]


Examples

    [r: median(3,6,2,2)]   
    [r: median(12, 23, 3, 102, 1)]

Returns

   2.5
   12