max

Common
JS
Native
1.7
@JvmName("maxOrThrow") fun Sequence<Double>.max(): Double
(source)
JVM
1.1
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun Sequence<Double>.max(): Double?
(source)
Deprecated: Use maxOrNull instead.
Common
JS
Native
1.7
@JvmName("maxOrThrow") fun Sequence<Float>.max(): Float
(source)
JVM
1.1
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun Sequence<Float>.max(): Float?
(source)
Deprecated: Use maxOrNull instead.

Returns the largest element.

If any of elements is NaN returns NaN.

The operation is terminal.

Exceptions

NoSuchElementException - if the sequence is empty.

Common
JS
Native
1.7
@JvmName("maxOrThrow") fun <T : Comparable<T>> Sequence<T>.max(): T
(source)
JVM
1.0
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun <T : Comparable<T>> Sequence<T>.max(): T?
(source)
Deprecated: Use maxOrNull instead.

Returns the largest element.

The operation is terminal.

Exceptions

NoSuchElementException - if the sequence is empty.