power method
This number to the power of exponent
.
It redirects to powerAsDynamicInt or powerAsDecimal depending of the exponent
type and value.
Implementation
@override
Decimal power(DynamicNumber<dynamic> exponent) {
if (exponent.isDecimal || exponent.isNegative) {
return _powerDecimal(exponent.toDecimal()).toDecimal();
} else {
if (isDecimalPartZero) {
return toDynamicInt().powerAsDynamicInt(exponent).toDecimal();
} else {
return _powerDynamicInt(exponent.toDynamicInt()).toDecimal();
}
}
}