JSPM

modular-power

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q9426F
  • License MIT

Find the modulo of a number raised to a power.

Package Exports

  • modular-power

Readme

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.