jsmodern
Version:
An extension to existing JavaScript, influenced by other great languages such as Rust, Dart, Java, Golang, etc.
14 lines • 464 B
JavaScript
import { utilDivFloor } from './div-floor';
export const modFloor = {
label: 'modFloor',
fn: function numberModFloor(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);
return ctx - (quotient * x);
},
};
//# sourceMappingURL=mod-floor.js.map