median
Computes the median of the value Array.
Notice -> In pair list of values, the median is the two middle value.
Example:
arrayOf(1 , 5 , 3 , 9 , 0 , 4).median() // (3, 4)
arrayOf(1 , 5 , 3 , 0 , 4).median() // (3 , null)
Content copied to clipboard
Since
1.1.0
Throws
IllegalArgumentException
if the Array is empty.
Computes the median of the value Iterable.
Notice -> In pair list of values, the median is the two middle value.
Example:
listOf(1 , 5 , 3 , 9 , 0 , 4).median() // (3, 4)
listOf(1 , 5 , 3 , 0 , 4).median() // (3 , null)
Content copied to clipboard
Since
1.1.0
Throws
IllegalArgumentException
if the Iterable is empty.