variance

Returns the population variance of this list.

The divisor is the element count, not count minus one. A single-element list has variance 0.0.

Throws

if the list is empty.


@JvmName(name = "varianceOfInt")
fun List<Int>.variance(): Double

Returns the population variance of this list.

Delegates to the List of Double overload after widening each element.

Throws

if the list is empty.


@JvmName(name = "varianceOfLong")
fun List<Long>.variance(): Double

Returns the population variance of this list.

Delegates to the List of Double overload after widening each element, which loses precision above 2^53.

Throws

if the list is empty.