js/src/tests/ecma_6/Math/expm1-approx.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 assertNear(Math.expm1(1e-300), 1e-300);
michael@0 2 assertNear(Math.expm1(1e-100), 1e-100);
michael@0 3 assertNear(Math.expm1(1e-14), 1.000000000000005e-14);
michael@0 4 assertNear(Math.expm1(1e-6), 0.0000010000005000001665);
michael@0 5
michael@0 6 var expm1_data = [
michael@0 7 [ -1.875817529344e-70, -1.875817529344e-70 ],
michael@0 8 [ -7.09962844069878e-15, -7.099628440698755e-15 ],
michael@0 9 [ -2.114990849122478e-10, -2.1149908488988187e-10 ],
michael@0 10 [ -0.0000031404608812881633, -0.000003140455950046052 ],
michael@0 11
michael@0 12 [ 1.875817529344e-70, 1.875817529344e-70 ],
michael@0 13 [ 6.261923313140869e-30, 6.261923313140869e-30 ],
michael@0 14 [ 7.09962844069878e-15, 7.099628440698805e-15 ],
michael@0 15 [ 1.3671879628418538e-12, 1.3671879628427884e-12 ],
michael@0 16 [ 2.114990849122478e-10, 2.1149908493461373e-10 ],
michael@0 17 [ 1.6900931765206906e-8, 1.6900931908027652e-8 ],
michael@0 18 [ 0.0000031404608812881633, 0.0000031404658125405988 ]
michael@0 19 ];
michael@0 20
michael@0 21 for (var [x, y] of expm1_data)
michael@0 22 assertNear(Math.expm1(x), y);
michael@0 23
michael@0 24 reportCompare(0, 0, "ok");

mercurial