just-modulo
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

just-modulo

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-modulo
yarn add just-modulo

Modulo of a number and a divisor

import modulo from 'just-modulo';

modulo(7, 5); // 2
modulo(17, 23); // 17
modulo(16.2, 3.8); // 1
modulo(5.8, 3.4); //2.4
modulo(4, 0); // 4
modulo(-7, 5); // 3
modulo(-2, 15); // 13
modulo(-5.8, 3.4); // 1
modulo(12, -1); // NaN
modulo(-3, -8); // NaN
modulo(12, 'apple'); // NaN
modulo('bee', 9); // NaN
modulo(null, undefined); // NaN

Package Sidebar

Install

npm i just-modulo

Weekly Downloads

400

Version

2.2.0

License

MIT

Unpacked Size

4.44 kB

Total Files

9

Last publish

Collaborators

  • angus-c