michael@0: function mod() michael@0: { michael@0: var mods = [-1,-1,-1,-1]; michael@0: var a = 9.5, b = -5, c = 42, d = (1/0); michael@0: for (var i = 0; i < 20; i++) { michael@0: mods[0] = a % b; michael@0: mods[1] = b % 1; michael@0: mods[2] = c % d; michael@0: mods[3] = c % a; michael@0: mods[4] = b % 0; michael@0: } michael@0: return mods.toString(); michael@0: } michael@0: assertEq(mod(), "4.5,0,42,4,NaN");