Math.pow different in stdlib

I must be missing something… Serverside math.pow takes 2 params, js side (Stdlib) it appears to only take one.

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.math/pow.html

Am I missing something

Where do you see a version that takes 2 params? Because I don’t see any. Also AFAIK the pow function has the same signature on all target platforms.

1 Like

i am doing this server side

    val numTiles = Math.pow(2.0, zoom)
    val metersPerTile = Math.cos(Math.toRadians(lat)) * 40074274.9 / numTiles

This is pow function from java.lang.Math class. You can import kotlin.math.* and use the same extension function pow as in Kotlin/JS. Note that it still takes two parameter, but the first of them comes as a receiver of extension function fun Double.pow(x: Double): Double