~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

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

Antero Mejr <antero@mailbox.org>
Details
Message ID
<20220627163104.7378-1-antero@mailbox.org>
DKIM signature
missing
Download raw message
Patch: +4 -4
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

[hare/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CL127QB8EPPY.LZC2NLKLT7XS@cirno>
In-Reply-To
<20220627163104.7378-1-antero@mailbox.org> (view parent)
DKIM signature
missing
Download raw message
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]: 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
Details
Message ID
<CL9DNTRMWHKQ.11ZBEL4KS3EEC@taiga>
In-Reply-To
<20220627163104.7378-1-antero@mailbox.org> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/hare
   10d78afa..1db5f9b5  master -> master
Reply to thread Export thread (mbox)