Skip to content

Commit f421b08

Browse files
committed
Remove unnecessary functions from JSMATH. NFC
See the comments at the top of `emscripten/js_math.h` for why JS versions of these functions are not needed. As a followup I plan to map `jsmath.c` functions to `em_math.h` functions instead of using EM_JS here. See #19284
1 parent 1171ada commit f421b08

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

system/lib/jsmath.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ CALL_JS_1_TRIPLE(atan, Math.atan)
2323
CALL_JS_1_TRIPLE(exp, Math.exp)
2424
CALL_JS_1_TRIPLE(log, Math.log)
2525
CALL_JS_1_TRIPLE(sqrt, Math.sqrt)
26-
CALL_JS_1_TRIPLE(fabs, Math.abs)
27-
CALL_JS_1_TRIPLE(ceil, Math.ceil)
28-
CALL_JS_1_TRIPLE(floor, Math.floor)
2926

3027
#define CALL_JS_2(cname, jsname, type, casttype) \
3128
EM_JS(type, JS_##cname, (type x, type y), { return jsname(x, y) }); \
@@ -50,11 +47,6 @@ CALL_JS_1_IMPL_TRIPLE(round, {
5047
return x >= 0 ? Math.floor(x + 0.5) : Math.ceil(x - 0.5);
5148
})
5249
CALL_JS_1_IMPL_TRIPLE(rint, {
53-
function round(x) {
54-
return x >= 0 ? Math.floor(x + 0.5) : Math.ceil(x - 0.5);
55-
}
50+
var round(x) => x >= 0 ? Math.floor(x + 0.5) : Math.ceil(x - 0.5);
5651
return (x - Math.floor(x) != .5) ? round(x) : round(x / 2) * 2;
5752
})
58-
59-
double nearbyint(double x) { return rint(x); }
60-
float nearbyintf(float x) { return rintf(x); }

0 commit comments

Comments
 (0)