pow

expect fun Double.pow(x: Double): Double(source)
expect fun Float.pow(x: Float): Float(source)

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

Since Kotlin

1.2

expect fun Double.pow(n: Int): Double(source)
expect fun Float.pow(n: Int): Float(source)

Raises this value to the integer power n.

See the other overload of pow for details.

Since Kotlin

1.2
actual inline fun Double.pow(x: Double): Double(source)
actual inline fun Float.pow(x: Float): Float(source)

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

Since Kotlin

1.2

actual inline fun Double.pow(n: Int): Double(source)
actual inline fun Float.pow(n: Int): Float(source)

Raises this value to the integer power n.

See the other overload of pow for details.

Since Kotlin

1.2
actual inline fun Double.pow(x: Double): Double(source)
actual inline fun Float.pow(x: Float): Float(source)

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

Since Kotlin

1.2

actual inline fun Double.pow(n: Int): Double(source)
actual inline fun Float.pow(n: Int): Float(source)

Raises this value to the integer power n.

See the other overload of pow for details.

Since Kotlin

1.2
actual external fun Double.pow(x: Double): Double(source)
actual external fun Float.pow(x: Float): Float(source)

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

Since Kotlin

1.3

actual fun Double.pow(n: Int): Double(source)
actual fun Float.pow(n: Int): Float(source)

Raises this value to the integer power n.

See the other overload of pow for details.

Since Kotlin

1.3