pow method Null safety

BigInt pow(
  1. int exponent
)

Returns this to the power of exponent.

Returns one if the exponent equals 0.

The exponent must otherwise be positive.

The result is always equal to the mathematical result of this to the power exponent, only limited by the available memory.

Example:

var value = BigInt.from(1000);
print(value.pow(0)); // 1
print(value.pow(1)); // 1000
print(value.pow(2)); // 1000000
print(value.pow(3)); // 1000000000
print(value.pow(4)); // 1000000000000
print(value.pow(5)); // 1000000000000000
print(value.pow(6)); // 1000000000000000000
print(value.pow(7)); // 1000000000000000000000
print(value.pow(8)); // 1000000000000000000000000

Implementation

BigInt pow(int exponent);