power(_:)

Returns this integer raised to the power exponent.

Exponentiation.swift:88
func power(_ exponent: Int) -> BigInt

Returns

1 if exponent == 0, otherwise self raised to exponent. (This implies that 0.power(0) == 1.)

This function calculates the result by successively squaring the base while halving the exponent.