powerAsDecimal method

  1. @override
Decimal powerAsDecimal(
  1. DynamicNumber exponent
)
override

This number to the power of DynamicNumber exponent as Decimal.

If exponent is a Decimal (without zero decimal part, Decimal.isDecimalPartZero), the precision will depend on dart:math pow function.

Implementation

@override
Decimal powerAsDecimal(DynamicNumber<dynamic> exponent) {
  if (exponent.isDecimal) {
    return toDecimal().powerAsDecimal(exponent);
  } else {
    return _powerDynamicIntImpl(exponent.toDynamicInt()).toDecimal();
  }
}