roundToLong
Rounds this Double value to the nearest integer and converts the result to Long. Ties are rounded towards positive infinity.
Special cases:
x.roundToLong() == Long.MAX_VALUE
whenx > Long.MAX_VALUE
x.roundToLong() == Long.MIN_VALUE
whenx < Long.MIN_VALUE
Since Kotlin
1.2Throws
when this value is NaN
Rounds this Float value to the nearest integer and converts the result to Long. Ties are rounded towards positive infinity.
Special cases:
x.roundToLong() == Long.MAX_VALUE
whenx > Long.MAX_VALUE
x.roundToLong() == Long.MIN_VALUE
whenx < Long.MIN_VALUE
Since Kotlin
1.2Throws
when this value is NaN
Rounds this Double value to the nearest integer and converts the result to Long. Ties are rounded towards positive infinity.
Special cases:
x.roundToLong() == Long.MAX_VALUE
whenx > Long.MAX_VALUE
x.roundToLong() == Long.MIN_VALUE
whenx < Long.MIN_VALUE
Since Kotlin
1.2Throws
when this value is NaN
Rounds this Float value to the nearest integer and converts the result to Long. Ties are rounded towards positive infinity.
Special cases:
x.roundToLong() == Long.MAX_VALUE
whenx > Long.MAX_VALUE
x.roundToLong() == Long.MIN_VALUE
whenx < Long.MIN_VALUE
Since Kotlin
1.2Throws
when this value is NaN
Rounds this Double value to the nearest integer and converts the result to Long. Ties are rounded towards positive infinity.
Special cases:
x.roundToLong() == Long.MAX_VALUE
whenx > Long.MAX_VALUE
x.roundToLong() == Long.MIN_VALUE
whenx < Long.MIN_VALUE
Since Kotlin
1.2Throws
when this value is NaN
Rounds this Float value to the nearest integer and converts the result to Long. Ties are rounded towards positive infinity.
Special cases:
x.roundToLong() == Long.MAX_VALUE
whenx > Long.MAX_VALUE
x.roundToLong() == Long.MIN_VALUE
whenx < Long.MIN_VALUE
Since Kotlin
1.2Throws
when this value is NaN