komikku/app/src/main/java/exh/util/Math.kt
2020-10-27 23:05:53 -04:00

11 lines
246 B
Kotlin

package exh.util
import kotlin.math.floor
fun Float.floor(): Int = floor(this).toInt()
fun Double.floor(): Int = floor(this).toInt()
fun Int.nullIfZero() = if (this == 0) null else this
fun Long.nullIfZero() = if (this == 0L) null else this