We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ce4dce commit abaf963Copy full SHA for abaf963
tests/jerry/es.next/math-cbrt.js
@@ -20,6 +20,11 @@ function isSameZero (x, y)
20
return x === 0 && (1 / x) === (1 / y);
21
}
22
23
+function approxEq (x, y)
24
+{
25
+ return Math.abs(x - y) <= Number.EPSILON * 2
26
+}
27
+
28
assert(isNaN(Math.cbrt(NaN)));
29
assert(isSameZero(Math.cbrt(p_zero), p_zero));
30
assert(isSameZero(Math.cbrt(n_zero), n_zero));
@@ -29,5 +34,5 @@ assert(Math.cbrt(Number.NEGATIVE_INFINITY) === Number.NEGATIVE_INFINITY);
34
assert(Math.cbrt(1.0) === 1.0);
35
assert(Math.cbrt(-1.0) === -1.0);
31
36
32
-// assert(Math.cbrt(27.0) === 3.0); // FIXME: unstable, depending on compiler and libm
33
-assert(Math.cbrt(0.001) === 0.1);
37
+assert(approxEq(Math.cbrt(27.0), 3.0));
38
+assert(approxEq(Math.cbrt(0.001), 0.1));
0 commit comments