Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/src/lib/libmath.js
4150 views
1
addToLibrary({
2
emscripten_math_cbrt: 'Math.cbrt',
3
emscripten_math_pow: 'Math.pow',
4
emscripten_math_random: 'Math.random',
5
emscripten_math_sign: 'Math.sign',
6
emscripten_math_sqrt: 'Math.sqrt',
7
emscripten_math_exp: 'Math.exp',
8
emscripten_math_expm1: 'Math.expm1',
9
emscripten_math_fmod: (x, y) => x % y,
10
emscripten_math_log: 'Math.log',
11
emscripten_math_log1p: 'Math.log1p',
12
emscripten_math_log10: 'Math.log10',
13
emscripten_math_log2: 'Math.log2',
14
emscripten_math_round: 'Math.round',
15
emscripten_math_acos: 'Math.acos',
16
emscripten_math_acosh: 'Math.acosh',
17
emscripten_math_asin: 'Math.asin',
18
emscripten_math_asinh: 'Math.asinh',
19
emscripten_math_atan: 'Math.atan',
20
emscripten_math_atanh: 'Math.atanh',
21
emscripten_math_atan2: 'Math.atan2',
22
emscripten_math_cos: 'Math.cos',
23
emscripten_math_cosh: 'Math.cosh',
24
emscripten_math_hypot: (count, varargs) => {
25
var args = [];
26
for (var i = 0; i < count; ++i) {
27
args.push({{{ makeGetValue('varargs', `i * ${getNativeTypeSize('double')}`, 'double') }}});
28
}
29
return Math.hypot(...args);
30
},
31
emscripten_math_sin: 'Math.sin',
32
emscripten_math_sinh: 'Math.sinh',
33
emscripten_math_tan: 'Math.tan',
34
emscripten_math_tanh: 'Math.tanh',
35
});
36
37