mirror of
https://github.com/tc39/test262.git
synced 2025-07-29 17:04:31 +02:00
Increase the tolerance of approx acos and cbrt tests
On engines which pass through these functions to the libc library they can return slightly different values depending on the OS and archictures. Showing a few example with Python, which also passes these through to libc on a few platforms I have access to: Ubuntu Noble, Python 12, s390x ``` >>> import math >>> math.cbrt(math.e) 1.3956124250860897 >>> math.acosh(math.cosh(0.2)) 0.20000000000000023 ``` Ubuntu Noble, Python 12, x86_64 ``` >>> import math >>> math.cbrt(math.e) 1.39561242508609 >>> math.acosh(math.cosh(0.2)) 0.20000000000000023 ``` MacOS 14, Python 12, x86_64 ``` >>> import math >>> math.cbrt(math.e) 1.3956124250860895 >>> math.acosh(math.cosh(0.2)) 0.20000000000000026 ```
This commit is contained in:
parent
2472953ec1
commit
c6251c64b1
@ -273,7 +273,7 @@ var cosh_data = [
|
|||||||
[1875817529344, 28.953212876533797]
|
[1875817529344, 28.953212876533797]
|
||||||
];
|
];
|
||||||
|
|
||||||
var sloppy_tolerance = 8; // FIXME
|
var sloppy_tolerance = 9; // FIXME
|
||||||
|
|
||||||
for (var [x, y] of cosh_data)
|
for (var [x, y] of cosh_data)
|
||||||
assertNear(Math.acosh(x), y, sloppy_tolerance);
|
assertNear(Math.acosh(x), y, sloppy_tolerance);
|
||||||
|
@ -22,6 +22,8 @@ var cbrt_data = [
|
|||||||
[ Math.SQRT2, 1.1224620483093728 ]
|
[ Math.SQRT2, 1.1224620483093728 ]
|
||||||
];
|
];
|
||||||
|
|
||||||
for (var [x, y] of cbrt_data)
|
var sloppy_tolerance = 3;
|
||||||
assertNear(Math.cbrt(x), y);
|
|
||||||
|
for (var [x, y] of cbrt_data)
|
||||||
|
assertNear(Math.cbrt(x), y, sloppy_tolerance);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user