2.0.0 • Published 4 years ago
modular-power v2.0.0
modular-power
Find the modulo of a number raised to a power. Similar to the pow() function in Python.
Install
npm install modular-powerUsage
import modularPower from 'modular-power';
modularPower(2, 3, 3);
//=> 2
modularPower(2, 3, 5);
//=> 3API
modularPower(base, exponent, modulus)
The type of return value type and arguments is determined by whether base is a number or BigInt.
base
The number to be raised to an exponent.
exponent
The exponent to apply to the base.
modulus
The modulus to apply to the exponent of the base.