max

@JvmName(name = "maxOrThrow")
fun Sequence<Double>.max(): Double(source)
@JvmName(name = "maxOrThrow")
fun Sequence<Float>.max(): Float(source)

Returns the largest element.

If any of elements is NaN returns NaN.

The operation is terminal.

Since Kotlin

1.7

Throws

if the sequence is empty.


@JvmName(name = "maxOrThrow")
fun <T : Comparable<T>> Sequence<T>.max(): T(source)

Returns the largest element.

The operation is terminal.

Since Kotlin

1.7

Throws

if the sequence is empty.

Deprecated

Warning since 1.4

Error since 1.5

Hidden since 1.6

Use maxOrNull instead.

Replace with

this.maxOrNull()

Since Kotlin

1.1

fun <T : Comparable<T>> Sequence<T>.max(): T?(source)

Deprecated

Warning since 1.4

Error since 1.5

Hidden since 1.6

Use maxOrNull instead.

Replace with

this.maxOrNull()

Since Kotlin

1.0