Minor: split math sources into regions

This commit is contained in:
Ilya Gorbunov
2018-10-18 22:10:15 +03:00
parent 5c0d516044
commit 406bd7c980
3 changed files with 24 additions and 9 deletions
+7 -2
View File
@@ -10,7 +10,7 @@ import kotlin.internal.InlineOnly
import kotlin.js.Math as nativeMath
// ================ Double Math ========================================
// region ================ Double Math ========================================
/** Computes the sine of the angle [x] given in radians.
*
@@ -543,10 +543,11 @@ public actual fun Double.roundToLong(): Long = when {
else -> nativeMath.round(this).unsafeCast<Double>().toLong()
}
// endregion
// ================ Float Math ========================================
// region ================ Float Math ========================================
/** Computes the sine of the angle [x] given in radians.
*
@@ -1010,6 +1011,9 @@ public actual inline fun Float.roundToInt(): Int = toDouble().roundToInt()
public actual inline fun Float.roundToLong(): Long = toDouble().roundToLong()
// endregion
// region ================ Integer Math ========================================
/**
@@ -1116,3 +1120,4 @@ public actual val Long.sign: Int get() = when {
}
// endregion