js/src/tests/ecma_6/Math/log1p-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.

     1 assertNear(Math.log1p(1e-300), 1e-300);
     2 assertNear(Math.log1p(1e-15), 9.999999999999995e-16);
     3 assertNear(Math.log1p(1e-6), 9.999995000003334e-7);
     5 var log1p_data = [
     6     [ 1.875817529344e-70, 1.875817529344e-70 ],
     7     [ 6.261923313140869e-30, 6.261923313140869e-30 ],
     8     [ 7.09962844069878e-15, 7.099628440698755e-15 ],
     9     [ 1.3671879628418538e-12, 1.3671879628409192e-12 ],
    10     [ 2.114990849122478e-10, 2.1149908488988187e-10 ],
    11     [ 1.6900931765206906e-8, 1.690093162238616e-8 ],
    12     [ 0.0000709962844069878, 0.00007099376429006658 ],
    13     [ 0.0016793412882520897, 0.00167793277137076 ],
    14     [ 0.011404608812881634, 0.011340066517988035 ],
    15 ];
    17 for (var [x, y] of log1p_data)
    18     assertNear(Math.log1p(x), y);
    20 reportCompare(0, 0, "ok");

mercurial