hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 1db5f9b50db3f74d677224592d9718c1cc6e119b
parent d25622dbc4b345f6d93c5e37ccb06a35b02373d8
Author: Antero Mejr <antero@mailbox.org>
Date:   Mon, 27 Jun 2022 12:31:04 -0400

tests: skip NaN sign-related complex tests

Skip tests where the libc implementation-dependent sign bit causes failure.
IEEE 754-2008 sec. 6.3: "When either an input or result is NaN, this standard
does not interpret the sign of a NaN."
Since the tests in question check the sign, they violate the standard.

Signed-off-by: Antero Mejr <antero@mailbox.org>

Diffstat:
Mmath/complex/+test.ha | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/math/complex/+test.ha b/math/complex/+test.ha @@ -1085,12 +1085,12 @@ fn isexact(x: f64) bool = }; for (let i = 0z; i < len(TEST_COSSC); i += 1) { const v = TEST_COSSC[i]; - assert(calike(v.1, cosc128(v.0))); - if (math::isnan(v.0.1) || math::isnan(v.1.1)) { + if (isnan(v.0) || math::isnan(v.1.1)) { // Negating NaN is undefined with regard to the sign bit // produced. continue; }; + assert(calike(v.1, cosc128(v.0))); // cos(conj(z)) == cos(cosh(z)) assert (calike(conjc128(v.1), cosc128(conjc128(v.0))) || calike(v.0, conjc128(v.0))); @@ -1111,12 +1111,12 @@ fn isexact(x: f64) bool = }; for (let i = 0z; i < len(TEST_COSHSC); i += 1) { const v = TEST_COSHSC[i]; - assert(calike(v.1, coshc128(v.0))); if (math::isnan(v.0.1) || math::isnan(v.1.1)) { // Negating NaN is undefined with regard to the sign bit // produced. continue; }; + assert(calike(v.1, coshc128(v.0))); // cosh(conj(z)) == conj(cosh(z)) assert(calike(conjc128(v.1), coshc128(conjc128(v.0))) || calike(v.0, conjc128(v.0))); @@ -1137,12 +1137,12 @@ fn isexact(x: f64) bool = }; for (let i = 0z; i < len(TEST_EXPSC); i += 1) { const v = TEST_EXPSC[i]; - assert(calike(v.1, expc128(v.0))); if (math::isnan(v.0.1) || math::isnan(v.1.1)) { // Negating NaN is undefined with regard to the sign bit // produced. continue; }; + assert(calike(v.1, expc128(v.0))); // exp(conj(z)) == exp(cosh(z)) assert(calike(conjc128(v.1), expc128(conjc128(v.0))) || calike(v.0, conjc128(v.0)));