Clarify floating-point to integral conversion rounding behaviour

This commit is contained in:
Abduqodiri Qurbonzoda
2019-08-13 08:26:15 +03:00
parent fd5bf33861
commit 432828a2db
7 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -313,7 +313,7 @@ public inline fun Long.toUInt(): UInt = UInt(this.toInt())
/**
* Converts this [Float] value to [UInt].
*
* The fractional part, if any, is rounded down.
* The fractional part, if any, is rounded down towards zero.
* Returns zero if this `Float` value is negative or `NaN`, [UInt.MAX_VALUE] if it's bigger than `UInt.MAX_VALUE`.
*/
@SinceKotlin("1.3")
@@ -323,7 +323,7 @@ public inline fun Float.toUInt(): UInt = doubleToUInt(this.toDouble())
/**
* Converts this [Double] value to [UInt].
*
* The fractional part, if any, is rounded down.
* The fractional part, if any, is rounded down towards zero.
* Returns zero if this `Double` value is negative or `NaN`, [UInt.MAX_VALUE] if it's bigger than `UInt.MAX_VALUE`.
*/
@SinceKotlin("1.3")
@@ -316,7 +316,7 @@ public inline fun Long.toULong(): ULong = ULong(this)
/**
* Converts this [Float] value to [ULong].
*
* The fractional part, if any, is rounded down.
* The fractional part, if any, is rounded down towards zero.
* Returns zero if this `Float` value is negative or `NaN`, [ULong.MAX_VALUE] if it's bigger than `ULong.MAX_VALUE`.
*/
@SinceKotlin("1.3")
@@ -326,7 +326,7 @@ public inline fun Float.toULong(): ULong = doubleToULong(this.toDouble())
/**
* Converts this [Double] value to [ULong].
*
* The fractional part, if any, is rounded down.
* The fractional part, if any, is rounded down towards zero.
* Returns zero if this `Double` value is negative or `NaN`, [ULong.MAX_VALUE] if it's bigger than `ULong.MAX_VALUE`.
*/
@SinceKotlin("1.3")