0.0.0 • Published 5 years ago
the-module v0.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-power
Usage
const modularPower = require("modular-power")
modularPower(2, 3, 3)
//=> 2
modularPower(2, 3, 5)
//=> 3
API
modularPower(base, exponent, modulo)
base
Type: number
The base number to get the exponent of.
exponent
Type: number
The exponent to apply to the base.
modulo
Type: number
The modulus to apply to the exponent of the base.