]> git.kaiwu.me - njs.git/commit
Tests: tolerate rounding differences in Math.tanh() master
authorJakub Jirutka <jakub@jirutka.cz>
Tue, 1 Dec 2026 15:44:28 +0000 (16:44 +0100)
committerDmitry Volyntsev <xeioexception@gmail.com>
Wed, 2 Dec 2026 00:56:24 +0000 (16:56 -0800)
commit91ed71753d9a629c94ccdeb56cb79a5d952980e2
tree545ff5de56d248e547fe2cd300926fbb522dbd73
parente029da26a11f8f56a730a109cfb1ace6fbc4a580
Tests: tolerate rounding differences in Math.tanh()

On Alpine Linux/i686, Math.tanh(0.5) differs from the reference
expression (Math.E - 1)/(Math.E + 1) by one ULP (about 5.55e-17).
The exact comparison fails with both SSE and x87 builds.

Allow an absolute difference of Number.EPSILON, as in the tests
for Math.atanh() and Math.acosh().
src/test/njs_unit_test.c