jessealama / decimal128

JavaScript userland partial implementation of IEEE 754 Decimal128 decimal floating-point arithmetic
BSD 2-Clause "Simplified" License
19 stars 8 forks source link

Add exponentiation as a new operation #2

Closed jessealama closed 1 year ago

jessealama commented 1 year ago

Exponentiation occurs in some financial contexts, such as calculating a mortgage's monthly payment with a certain interest rate, principal, and term. There are undoubtedly other contexts in which exponentiation is a natural operation to use. Moreover, it is conceivable that the exponent of an exponentiation operation is not necessarily an integer, so it's not enough to say that exponentiation can be emulated simply by doing a few repeated multiplications.

jessealama commented 1 year ago

The new method should take one or two arguments.