summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_6/Math/log1p-approx.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/tests/ecma_6/Math/log1p-approx.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/tests/ecma_6/Math/log1p-approx.js')
-rw-r--r--js/src/tests/ecma_6/Math/log1p-approx.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/ecma_6/Math/log1p-approx.js b/js/src/tests/ecma_6/Math/log1p-approx.js
new file mode 100644
index 000000000..f1d120af6
--- /dev/null
+++ b/js/src/tests/ecma_6/Math/log1p-approx.js
@@ -0,0 +1,20 @@
+assertNear(Math.log1p(1e-300), 1e-300);
+assertNear(Math.log1p(1e-15), 9.999999999999995e-16);
+assertNear(Math.log1p(1e-6), 9.999995000003334e-7);
+
+var log1p_data = [
+ [ 1.875817529344e-70, 1.875817529344e-70 ],
+ [ 6.261923313140869e-30, 6.261923313140869e-30 ],
+ [ 7.09962844069878e-15, 7.099628440698755e-15 ],
+ [ 1.3671879628418538e-12, 1.3671879628409192e-12 ],
+ [ 2.114990849122478e-10, 2.1149908488988187e-10 ],
+ [ 1.6900931765206906e-8, 1.690093162238616e-8 ],
+ [ 0.0000709962844069878, 0.00007099376429006658 ],
+ [ 0.0016793412882520897, 0.00167793277137076 ],
+ [ 0.011404608812881634, 0.011340066517988035 ],
+];
+
+for (var [x, y] of log1p_data)
+ assertNear(Math.log1p(x), y);
+
+reportCompare(0, 0, "ok");