Here you can find the source of mod( n )
/**//from ww w.j a v a 2 s. c o m * Taking the modulus of a negative number in JavaScript is wonky. * And we need to do exactly that (in IntervalVector). So here's a * workaround. Taken from here: * * http://javascript.about.com/od/problemsolving/a/modulobug.htm */ Number.prototype.mod = function( n ) { return ( ( this % n ) + n ) % n; };
Number.prototype.mod =function(d) { var rem = this%d; return rem < 0? d+rem: rem; };
Number.prototype.mod = function(n) { return ((this % n)+ n ) % n;
Number.prototype.mod = function(n) { return ((this%n)+n)%n; var divisors = (num) => { var holder = [] for(var i = 2; i < num; i++){ if(num % i == 0){ holder.push(i) return holder.length != 0 ? holder : num + " is prime" console.log(divisors(13))
Number.prototype.mod = function (n) { return ((this % n) + n) % n;