UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

9 lines (6 loc) 230 B
import { isInteger } from './_internals/isInteger.js' export function mathMod(x, y){ if (arguments.length === 1) return _y => mathMod(x, _y) if (!isInteger(x) || !isInteger(y) || y < 1) return NaN return (x % y + y) % y }