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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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