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>
---
math/complex/+test.ha | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/math/complex/+test.ha b/math/complex/+test.ha
index a1cc0916..d5627853 100644
--- 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)));
--
2.36.1