Skip to content

Commit

Permalink
test/lit: Make abs() integration test slightly more interesting
Browse files Browse the repository at this point in the history
I had accidentally not included this local diff in the PR that was
merged as commit cdaf554.

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.
  • Loading branch information
dnadlinger committed Apr 14, 2019
1 parent b4b9ec5 commit dc7a642
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions artiq/test/lit/integration/abs.py
Expand Up @@ -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

0 comments on commit dc7a642

Please sign in to comment.