Lines Matching full:divisor
44 function run_tests_for(divisor) {
45 print("(function(left) { return left / " + divisor + "; })");
46 var div_func = this.eval("(function(left) { return left / " + divisor + "; })");
47 var mod_func = this.eval("(function(left) { return left % " + divisor + "; })");
50 divmod(div_func, mod_func, 0, divisor);
51 divmod(div_func, mod_func, 1 / 0, divisor);
54 divmod(div_func, mod_func, Math.pow(2, exp), divisor);
55 divmod(div_func, mod_func, 0.9999999 * Math.pow(2, exp), divisor);
56 divmod(div_func, mod_func, 1.0000001 * Math.pow(2, exp), divisor);
60 divmod(div_func, mod_func, 1 << exp, divisor);
61 divmod(div_func, mod_func, (1 << exp) + 1, divisor);
62 divmod(div_func, mod_func, (1 << exp) - 1, divisor);
64 divmod(div_func, mod_func, Math.floor(0x1fffffff / 3), divisor);
65 divmod(div_func, mod_func, Math.floor(-0x20000000 / 3), divisor);
95 function compute_mod(dividend, divisor) {
96 // Return NaN if either operand is NaN, if divisor is 0 or
97 // dividend is an infinity. Return dividend if divisor is an infinity.
98 if (isNaN(dividend) || isNaN(divisor) || divisor == 0) { return NaN; }
102 if (divisor < 0) { divisor = -divisor; }
103 if (divisor == Infinity) { return sign * dividend; }
112 return sign * rec_mod(dividend, divisor);