Home | History | Annotate | Download | only in mjsunit

Lines Matching full:divisor

42 function run_tests_for(divisor) {
43 print("(function(left) { return left / " + divisor + "; })");
44 var div_func = this.eval("(function(left) { return left / " + divisor + "; })");
45 var mod_func = this.eval("(function(left) { return left % " + divisor + "; })");
48 divmod(div_func, mod_func, 0, divisor);
49 divmod(div_func, mod_func, 1 / 0, divisor);
52 divmod(div_func, mod_func, Math.pow(2, exp), divisor);
53 divmod(div_func, mod_func, 0.9999999 * Math.pow(2, exp), divisor);
54 divmod(div_func, mod_func, 1.0000001 * Math.pow(2, exp), divisor);
58 divmod(div_func, mod_func, 1 << exp, divisor);
59 divmod(div_func, mod_func, (1 << exp) + 1, divisor);
60 divmod(div_func, mod_func, (1 << exp) - 1, divisor);
62 divmod(div_func, mod_func, Math.floor(0x1fffffff / 3), divisor);
63 divmod(div_func, mod_func, Math.floor(-0x20000000 / 3), divisor);
93 function compute_mod(dividend, divisor) {
94 // Return NaN if either operand is NaN, if divisor is 0 or
95 // dividend is an infinity. Return dividend if divisor is an infinity.
96 if (isNaN(dividend) || isNaN(divisor) || divisor == 0) { return NaN; }
100 if (divisor < 0) { divisor = -divisor; }
101 if (divisor == Infinity) { return sign * dividend; }
110 return sign * rec_mod(dividend, divisor);