michael@0: // Bug 894781 michael@0: function m(stdlib) michael@0: { michael@0: "use asm"; michael@0: var abs = stdlib.Math.abs; michael@0: function f(d) michael@0: { michael@0: d = +d; michael@0: return (~~(5.0 - +abs(d)))|0; michael@0: } michael@0: return f; michael@0: } michael@0: var f = m(this); michael@0: assertEq(f(0.2), 4); michael@0: assertEq(f(NaN), 0);