modular-power
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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

import modularPower from 'modular-power';

modularPower(2, 3, 3);
//=> 2

modularPower(2, 3, 5);
//=> 3

API

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.

Readme

Keywords

Package Sidebar

Install

npm i modular-power

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

4.5 kB

Total Files

5

Last publish

Collaborators

  • richienb