source:
frontend/node_modules/math-intrinsics/mod.js
| Last change on this file was 9af201e, checked in by , 11 days ago | |
|---|---|
|
|
| File size: 218 bytes | |
| Line | |
|---|---|
| 1 | 'use strict'; |
| 2 | |
| 3 | var $floor = require('./floor'); |
| 4 | |
| 5 | /** @type {import('./mod')} */ |
| 6 | module.exports = function mod(number, modulo) { |
| 7 | var remain = number % modulo; |
| 8 | return $floor(remain >= 0 ? remain : remain + modulo); |
| 9 | }; |
Note:
See TracBrowser
for help on using the repository browser.
