Even more math (#56)

Remaining implementations of JavaScript's Math functions (except sin/cos/tan), both double (Math) and single (Mathf) precision, ported from musl incl. tests from libc-test, plus some changes to match JS semantics. Also binds fmod to `%` and pow to `**`.
This commit is contained in:
Daniel Wirtz
2018-03-30 17:25:54 +02:00
committed by GitHub
parent e47a130771
commit 164f134053
29 changed files with 143290 additions and 15143 deletions

View File

@ -113,7 +113,7 @@ tests.forEach(filename => {
let exports = new WebAssembly.Instance(new WebAssembly.Module(stdout.toBuffer()), {
env: {
abort: function(msg, file, line, column) {
// TODO
console.log("abort called at " + line + ":" + column);
},
externalFunction: function() { },
externalConstant: 1,
@ -124,6 +124,9 @@ tests.forEach(filename => {
externalFunction: function() { },
externalConstant: 2
},
JSOp: {
mod: function(a, b) { return a % b; }
},
JSMath: Math
});
});