Spaces:
Running
Running
/** | |
* Always positive modulus | |
* @param {int} n Modulus | |
* @returns {int} this modulo n | |
*/ | |
Number.prototype.mod = function(n) { | |
return ((this%n)+n)%n; | |
} | |