~sircmpwn/hare-dev

hare: tests: skip NaN sign-related complex tests v1 APPLIED

Antero Mejr: 1
 tests: skip NaN sign-related complex tests

 1 files changed, 4 insertions(+), 4 deletions(-)
#789115 alpine.yml success
#789116 freebsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/hare-dev/patches/33328/mbox | git am -3
Learn more about email & git

[PATCH hare] tests: skip NaN sign-related complex tests Export this patch

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
Thanks!

To git@git.sr.ht:~sircmpwn/hare
   10d78afa..1db5f9b5  master -> master
hare/patches: SUCCESS in 1m43s

[tests: skip NaN sign-related complex tests][0] from [Antero Mejr][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/33328
[1]: mailto:antero@mailbox.org

✓ #789115 SUCCESS hare/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/789115
✓ #789116 SUCCESS hare/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/789116