From 3743913ce2c5bc37f899d437c09b60cbb3bc6dea Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 3 Nov 2024 15:48:13 -0500 Subject: Add unsigned integer shifts --- test/integers.tm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/integers.tm b/test/integers.tm index 8d34dfc0..225baab5 100644 --- a/test/integers.tm +++ b/test/integers.tm @@ -17,6 +17,16 @@ func main(): >> 1 << 10 = 1024 + !! Signed and unsigned bit shifting: + >> -2[64] << 1 + = -4[64] + >> -2[64] <<[u] 1 + = -4[64] + >> -2[64] >> 1 + = -1[64] + >> -2[64] >>[u] 1 + = 9223372036854775807[64] + >> 3 and 2 = 2 -- cgit v1.2.3