replace repeat() with pow() (#177)

This commit is contained in:
Abe Pazos
2021-03-06 22:24:49 +01:00
committed by GitHub
parent 714969e1b7
commit c43e6c633e

View File

@@ -254,7 +254,6 @@ fun XYPad.bind(property: KMutableProperty0<Vector2>) {
}
fun Double.round(decimals: Int): Double {
var multiplier = 1.0
repeat(decimals) { multiplier *= 10 }
val multiplier = 10.0.pow(decimals)
return round(this * multiplier) / multiplier
}