Skip to content

Commit ebd6f3c

Browse files
authored
Remove rint from jsmath library. NFC (#23148)
We use `__builtin_rint` (which lowers to a single `f64.nearest` instruction) when compiling the musl version of `rint.c` so there there is no need to use a JS call for this case.
1 parent a8d325c commit ebd6f3c

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

system/lib/jsmath.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,3 @@ CALL_JS_2_TRIPLE(pow)
4545
CALL_JS_1_IMPL_TRIPLE(round, {
4646
return x >= 0 ? Math.floor(x + 0.5) : Math.ceil(x - 0.5);
4747
})
48-
CALL_JS_1_IMPL_TRIPLE(rint, {
49-
function round(x) {
50-
return x >= 0 ? Math.floor(x + 0.5) : Math.ceil(x - 0.5);
51-
}
52-
return (x - Math.floor(x) != .5) ? round(x) : round(x / 2) * 2;
53-
})

0 commit comments

Comments
 (0)