1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 17:45:07 +00:00
serenity/Libraries/LibJS/Tests/Math.cbrt.js
2020-06-22 10:33:50 +02:00

16 lines
413 B
JavaScript

load("test-common.js");
try {
assert(isNaN(Math.cbrt(NaN)));
assert(Math.cbrt(-1) === -1);
assert(Math.cbrt(-0) === -0);
assert(Math.cbrt(-Infinity) === -Infinity);
assert(Math.cbrt(1) === 1);
assert(Math.cbrt(Infinity) === Infinity);
assert(Math.cbrt(null) === 0);
assert(isClose(Math.cbrt(2), 1.259921));
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}