commonMain.androidx.constraintlayout.utility.Utils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktx-compose-constraint-layout Show documentation
Show all versions of ktx-compose-constraint-layout Show documentation
Extensions for the Kotlin standard library and third-party libraries.
The newest version!
package androidx.constraintlayout.utility
import kotlin.math.PI
import kotlin.math.pow
internal object Utils {
fun radians(degrees: Double) = degrees * PI / 180
fun degrees(radians: Double) = radians * 180 / PI
fun pow(first: Double, second: Double) = first.pow(second)
fun signum(value: Double): Double = when {
value.isNaN() -> Double.NaN
value < 0.0 -> -1.0
value == 0.0 -> 0.0
else -> 1.0
}
fun signum(value: Float): Float = when {
value.isNaN() -> Float.NaN
value < 0f -> -1f
value == 0f -> 0f
else -> 1f
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy