W3cubDocs

/Kotlin

pow

inline fun Double.pow(x: Double): Double

Platform and version requirements: Kotlin 1.2

inline fun Float.pow(x: Float): Float

Platform and version requirements: Kotlin 1.2

Raises this value to the power x.

Special cases:

  • b.pow(0.0) is 1.0
  • b.pow(1.0) == b
  • b.pow(NaN) is NaN
  • NaN.pow(x) is NaN for x != 0.0
  • b.pow(Inf) is NaN for abs(b) == 1.0
  • b.pow(x) is NaN for b < 0 and x is finite and not an integer
inline fun Double.pow(n: Int): Double

Platform and version requirements: Kotlin 1.2

inline fun Float.pow(n: Int): Float

Platform and version requirements: Kotlin 1.2

Raises this value to the integer power n.

See the other overload of pow for details.

© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.math/pow.html