What is the exponent operator in Kotlin. I assumed it would be ** but it seems to throw up an error in my code.
**
when (pendingOperation) { \"
If you need a cross platform version that does not depend on java.lang or Kotlin's Double.pow, this simple implementation will work:
java.lang
Double.pow
fun pow(value: Long, exp: Int): Long { return when { exp > 1 -> value * pow(value,exp-1) exp == 1 -> value else -> 1 } }