// Ion provides specialisations when Math.pow() resp. the **-operator is used // with a constant power of one of [-0.5, 0.5, 1, 2, 3, 4].
function test(x, y, z) { function pow(x, y) { return `Math.pow(${x}, ${y})` }; function exp(x, y) { return `((${x}) ** ${y})` };
function make(fn, x, y, z) { returnFunction(` // Load from array to prevent constant-folding. // (Ion is currently not smart enough to realise that both array // values are the same.) var xs = [${x}, ${x}]; var zs = [${z}, ${z}]; for (var i = 0; i < 1000; ++i) {
assertEq(${fn("xs[i & 1]", y)}, zs[i & 1]);
}
`);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.