Closed bfontaine closed 6 years ago
As long as the e_value is positive, the code works because pow returns an int. If it’s negative, pow returns a float, and the Decimal*float operation fails because * isn’t defined for these types. Using Decimals for both operands fixes that.
e_value
pow
float
Decimal*float
*
Decimal
As long as the
e_value
is positive, the code works becausepow
returns an int. If it’s negative,pow
returns afloat
, and theDecimal*float
operation fails because*
isn’t defined for these types. UsingDecimal
s for both operands fixes that.