diff options
| author | Mistivia <i@mistivia.com> | 2025-06-28 15:19:26 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-06-28 15:19:26 +0800 |
| commit | 9efc0e78ad1609217752b5aa02fbb389d726e9c7 (patch) | |
| tree | 4fcc801fa760ed9c0796afcc80662b9e9fc927ff /tests/bitwise.lisp | |
| parent | 878a056f3accafaa797446eb3a3b1a66b36d0d07 (diff) | |
add builtin funcs
Diffstat (limited to 'tests/bitwise.lisp')
| -rw-r--r-- | tests/bitwise.lisp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/bitwise.lisp b/tests/bitwise.lisp index 7371058..4c1ad73 100644 --- a/tests/bitwise.lisp +++ b/tests/bitwise.lisp @@ -1,2 +1,18 @@ (assert (= 16 (logand 31 16))) (assert (= 24 (logand 31 25 24))) + +(assert (= 25 (logior 24 16 1))) +(assert (= 25 (logior 8 16 1))) + +(assert (= 678 (logxor 123 456 789))) + +(assert (= -124 (lognot 123))) + +(assert (= 246 (lsh 123 1))) + +(assert (= 30 (ash 123 2))) +(assert (= -31 (ash -123 2))) + +(assert (= 30 (ash 123 2))) +(assert (= -31 (ash -123 2))) + |
