UNPKG

@litecanvas/utils

Version:

Utilities to help build litecanvas games

9 lines (8 loc) 200 B
/** * Math modulus (always returns a positive number). * * @param {number} a dividend * @param {number} b divisor * @returns {number} the remainder */ export default (a, b) => (b + (a % b)) % b