From dc7a642b2656727d3f314d6670e3f8c07b980333 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sun, 14 Apr 2019 04:12:37 +0100 Subject: [PATCH] test/lit: Make abs() integration test slightly more interesting I had accidentally not included this local diff in the PR that was merged as commit cdaf554736302594613bda6850fda25192f61e0c. Doesn't include tests for any of the interesting edge cases yet (nans, infinities, signed zero, int.min), some of which might be handled differently than by the host Python. In particular, the select condition should logically use copysign(arg, 1) for the comparison (i.e., always clear the sign bit), but currently the chance of anyone running FP-heavy algorithms where this would matter on the core device is close to zero [1]. [1] Sign of your choice. --- artiq/test/lit/integration/abs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/test/lit/integration/abs.py b/artiq/test/lit/integration/abs.py index 877cf6c9a..ba279ab4b 100644 --- a/artiq/test/lit/integration/abs.py +++ b/artiq/test/lit/integration/abs.py @@ -3,5 +3,5 @@ assert abs(1234) == 1234 assert abs(-1234) == 1234 -assert abs(1234.0) == 1234.0 -assert abs(-1234.0) == 1234 +assert abs(1234.5) == 1234.5 +assert abs(-1234.5) == 1234.5