kotlin / 1.7.0 / api / latest / jvm / stdlib / kotlin.sequences / max.html /

max

Platform and version requirements: JS (1.7), Native (1.7)
@JvmName("maxOrThrow") fun Sequence<Double>.max(): Double
Platform and version requirements: JVM (1.1)
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun Sequence<Double>.max(): Double?
Deprecated: Use maxOrNull instead.
Platform and version requirements: JS (1.7), Native (1.7)
@JvmName("maxOrThrow") fun Sequence<Float>.max(): Float
Platform and version requirements: JVM (1.1)
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun Sequence<Float>.max(): Float?
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.

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

Returns the largest element.

The operation is terminal.

Exceptions

NoSuchElementException - if the sequence is empty.

© 2010–2022 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/max.html