UNPKG

jsmodern

Version:

An extension to existing JavaScript, influenced by other great languages such as Rust, Dart, Java, Golang, etc.

15 lines 526 B
import { utilDivFloor } from './div-floor'; export const divModFloor = { label: 'divModFloor', fn: function numberDivModFloor(divisor) { const ctx = this; const x = Number(divisor); if (!x) { throw new TypeError(`Invalid 'divisor'. The value must be a number that is greater than zero`); } const quotient = utilDivFloor(ctx, x); const remainder = ctx - (x * quotient); return [quotient, remainder]; }, }; //# sourceMappingURL=div-mod-floor.js.map