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
@@ -36,7 +36,7 @@ private object Constants {
}
// ================ Double Math ========================================
// region ================ Double Math ========================================
/** Computes the sine of the angle [x] given in radians.
*
@@ -619,8 +619,11 @@ public actual fun Double.roundToInt(): Int = when {
public actual fun Double.roundToLong(): Long =
if (isNaN()) throw IllegalArgumentException("Cannot round NaN value.") else nativeMath.round(this)
// endregion
// ================ Float Math ========================================
// region ================ Float Math ========================================
/** Computes the sine of the angle [x] given in radians.
*
@@ -1142,8 +1145,10 @@ public actual fun Float.roundToInt(): Int =
public actual fun Float.roundToLong(): Long = toDouble().roundToLong()
// endregion
// region ================ Integer Math ========================================
// ================== Integer math functions =====================================
/**
* Returns the absolute value of the given value [n].
@@ -1249,3 +1254,5 @@ public actual val Long.sign: Int get() = when {
else -> 0
}
// endregion