diff options
Diffstat (limited to 'testsuite/tests/numeric')
77 files changed, 67463 insertions, 0 deletions
diff --git a/testsuite/tests/numeric/Makefile b/testsuite/tests/numeric/Makefile new file mode 100644 index 0000000000..9a36a1c5fe --- /dev/null +++ b/testsuite/tests/numeric/Makefile @@ -0,0 +1,3 @@ +TOP=../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/numeric/should_run/1603.hs b/testsuite/tests/numeric/should_run/1603.hs new file mode 100644 index 0000000000..09dd05a550 --- /dev/null +++ b/testsuite/tests/numeric/should_run/1603.hs @@ -0,0 +1,7 @@ +module Main where + +main = print (syn [-1]) + +syn :: [Int] -> [Int] +syn (d:ds) = rem d 0x40000000 : syn ds +syn [] = [] diff --git a/testsuite/tests/numeric/should_run/1603.stdout b/testsuite/tests/numeric/should_run/1603.stdout new file mode 100644 index 0000000000..2363a1ac08 --- /dev/null +++ b/testsuite/tests/numeric/should_run/1603.stdout @@ -0,0 +1 @@ +[-1] diff --git a/testsuite/tests/numeric/should_run/3676.hs b/testsuite/tests/numeric/should_run/3676.hs new file mode 100644 index 0000000000..242a9c5bb3 --- /dev/null +++ b/testsuite/tests/numeric/should_run/3676.hs @@ -0,0 +1,32 @@ +-- test conversion of funny numbers through Rational (#3676) + +main = mapM_ putStrLn $ concat $ + [map (show.d2d) doubles1, + map (show.d2f) doubles1, + map (show.d2r) doubles1, + map (show.f2d) floats1, + map (show.f2f) floats1, + map (show.f2r) floats1, + map (show.d2d) doubles2, + map (show.d2f) doubles2, + map (show.d2r) doubles2, + map (show.f2d) floats2, + map (show.f2f) floats2, + map (show.f2r) floats2 + ] + +d2d = realToFrac :: Double -> Double +d2f = realToFrac :: Double -> Float +d2r = realToFrac :: Double -> Rational +f2d = realToFrac :: Float -> Double +f2f = realToFrac :: Float -> Float +f2r = realToFrac :: Float -> Rational + +doubles1 = [0/0, 1/0, -1/0, 0/(-1)] :: [Double] +floats1 = [0/0, 1/0, -1/0, 0/(-1)] :: [Float] + +doubles2 = names :: [Double] +floats2 = names :: [Float] + +names :: Read a => [a] +names = map read ["NaN", "Infinity", "-Infinity", "-0"] diff --git a/testsuite/tests/numeric/should_run/3676.stdout b/testsuite/tests/numeric/should_run/3676.stdout new file mode 100644 index 0000000000..ab3234f458 --- /dev/null +++ b/testsuite/tests/numeric/should_run/3676.stdout @@ -0,0 +1,48 @@ +NaN +Infinity +-Infinity +-0.0 +NaN +Infinity +-Infinity +-0.0 +0 % 0 +1 % 0 +(-1) % 0 +0 % (-1) +NaN +Infinity +-Infinity +-0.0 +NaN +Infinity +-Infinity +-0.0 +0 % 0 +1 % 0 +(-1) % 0 +0 % (-1) +NaN +Infinity +-Infinity +-0.0 +NaN +Infinity +-Infinity +-0.0 +0 % 0 +1 % 0 +(-1) % 0 +0 % (-1) +NaN +Infinity +-Infinity +-0.0 +NaN +Infinity +-Infinity +-0.0 +0 % 0 +1 % 0 +(-1) % 0 +0 % (-1) diff --git a/testsuite/tests/numeric/should_run/4381.hs b/testsuite/tests/numeric/should_run/4381.hs new file mode 100644 index 0000000000..e55a86939e --- /dev/null +++ b/testsuite/tests/numeric/should_run/4381.hs @@ -0,0 +1,5 @@ +module Main where + +main = do + print (scaleFloat 30000 1) + print (scaleFloat (maxBound :: Int) 1) diff --git a/testsuite/tests/numeric/should_run/4381.stdout b/testsuite/tests/numeric/should_run/4381.stdout new file mode 100644 index 0000000000..715699eb5e --- /dev/null +++ b/testsuite/tests/numeric/should_run/4381.stdout @@ -0,0 +1,2 @@ +Infinity +Infinity diff --git a/testsuite/tests/numeric/should_run/4383.hs b/testsuite/tests/numeric/should_run/4383.hs new file mode 100644 index 0000000000..06c7b265d7 --- /dev/null +++ b/testsuite/tests/numeric/should_run/4383.hs @@ -0,0 +1 @@ +main = print (0.5 ^ 1030) diff --git a/testsuite/tests/numeric/should_run/4383.stdout b/testsuite/tests/numeric/should_run/4383.stdout new file mode 100644 index 0000000000..d6e38dc3fc --- /dev/null +++ b/testsuite/tests/numeric/should_run/4383.stdout @@ -0,0 +1 @@ +8.691694759794e-311 diff --git a/testsuite/tests/numeric/should_run/Makefile b/testsuite/tests/numeric/should_run/Makefile new file mode 100644 index 0000000000..9101fbd40a --- /dev/null +++ b/testsuite/tests/numeric/should_run/Makefile @@ -0,0 +1,3 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T new file mode 100644 index 0000000000..0916af1d7d --- /dev/null +++ b/testsuite/tests/numeric/should_run/all.T @@ -0,0 +1,50 @@ +# Args to compile_and_run are: +# extra compile flags +# extra run flags +# expected process return value, if not zero + +test('arith001', normal, compile_and_run, ['']) +test('arith002', normal, compile_and_run, ['']) +test('arith003', normal, compile_and_run, ['']) +test('arith004', normal, compile_and_run, ['']) +test('arith005', normal, compile_and_run, ['']) +test('arith006', normal, compile_and_run, ['']) +test('arith007', normal, compile_and_run, ['']) + +# On i386, we need -msse2 to get reliable floating point results +ways = normal +opts = '' +if config.platform.startswith('i386-'): + if config.compiler_type == 'ghc' and \ + version_ge(config.compiler_version, '6.13'): + opts = '-msse2' + else: + ways = expect_fail_for(['optasm','threaded2','hpc','dyn','profasm']) + +test('arith008', ways, compile_and_run, [opts]) + +test('arith009', normal, compile_and_run, ['']) +test('arith010', normal, compile_and_run, ['']) +test('arith011', normal, compile_and_run, ['']) + +test('arith012', ways, compile_and_run, [opts]) + +test('arith013', compose(normal,only_compiler_types(['ghc'])), compile_and_run, ['']) +test('arith014', normal, compile_and_run, ['']) +test('arith015', normal, compile_and_run, ['']) +test('numrun009', normal, compile_and_run, ['']) +test('numrun010', normal, compile_and_run, ['']) +test('numrun011', normal, compile_and_run, ['']) +test('numrun012', normal, compile_and_run, ['']) +test('numrun013', normal, compile_and_run, ['']) +test('numrun014', normal, compile_and_run, ['']) +test('arith016', compose(normal,only_compiler_types(['ghc'])), compile_and_run, ['']) +test('arith017', normal, compile_and_run, ['']) +test('arith018', normal, compile_and_run, ['']) +test('arith019', normal, compile_and_run, ['']) +test('expfloat', normal, compile_and_run, ['']) + +test('1603', skip, compile_and_run, ['']) +test('3676', expect_broken(3676), compile_and_run, ['']) +test('4381', normal, compile_and_run, ['']) +test('4383', normal, compile_and_run, ['']) diff --git a/testsuite/tests/numeric/should_run/arith001.hs b/testsuite/tests/numeric/should_run/arith001.hs new file mode 100644 index 0000000000..ed9cd5febc --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith001.hs @@ -0,0 +1,28 @@ +-- !!! conversions: Double <=> Rational/Integer things +-- +import Data.Ratio + +main = putStr (show r42 ++ "\n" ++ + show nu42 ++ ", " ++ + show de42 ++ "\n" ++ + show nu42d ++ ", " ++ + show de42d ++ "\n" ++ + show s2 ++ ", " ++ + show e2 ++ "\n" ++ + show s ++ ", " ++ + show e ++ "\n" ) + where + d42 :: Double + r42 :: Rational + nu42, de42 :: Integer + nu42d, de42d :: Double + + d42 = 42 + r42 = toRational d42 + nu42 = numerator r42 + de42 = denominator r42 + nu42d= fromInteger nu42 + de42d= fromInteger de42 + + (s,e)= decodeFloat (nu42d / de42d ) + (s2,e2) = decodeFloat d42 diff --git a/testsuite/tests/numeric/should_run/arith001.stdout b/testsuite/tests/numeric/should_run/arith001.stdout new file mode 100644 index 0000000000..741c4809ef --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith001.stdout @@ -0,0 +1,5 @@ +42 % 1 +42, 1 +42.0, 1.0 +5910974510923776, -47 +5910974510923776, -47 diff --git a/testsuite/tests/numeric/should_run/arith001.stdout-ghc b/testsuite/tests/numeric/should_run/arith001.stdout-ghc new file mode 100644 index 0000000000..741c4809ef --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith001.stdout-ghc @@ -0,0 +1,5 @@ +42 % 1 +42, 1 +42.0, 1.0 +5910974510923776, -47 +5910974510923776, -47 diff --git a/testsuite/tests/numeric/should_run/arith002.hs b/testsuite/tests/numeric/should_run/arith002.hs new file mode 100644 index 0000000000..b7f5acf136 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith002.hs @@ -0,0 +1,52 @@ +-- !!! basic Rational operations +-- +import Data.Ratio + +main + = putStr + (-- Ratio Ints + show [i0a, i0b, i0c, i2a, i2b, im2a, im2b, i_pi, i_misc] + ++ "\n" + -- the Ints + ++ show ((map numerator [i0a, i0b, i0c, i2a, i2b, im2a, im2b, i_pi, i_misc]) + ++(map denominator [i0a, i0b, i0c, i2a, i2b, im2a, im2b, i_pi, i_misc])) + ++ "\n" + -- Booleans +-- ++ show [] +-- ++ "\n" + + -- Rationals (Ratio Integers) + ++ show [r0a, r0b, r0c, r2a, r2b, rm2a, rm2b, r_pi, r_misc] + ++ "\n" + -- the Integers + ++ show ((map numerator [r0a, r0b, r0c, r2a, r2b, rm2a, rm2b, r_pi, r_misc]) + ++(map denominator [r0a, r0b, r0c, r2a, r2b, rm2a, rm2b, r_pi, r_misc])) + ++ "\n" + -- Booleans +-- ++ show [] +-- ++ "\n" + ) + where + i0a, i0b, i0c, i2a, i2b, im2a, im2b, i_pi, i_misc :: Ratio Int + + i0a = 0 % 1 + i0b = (-0) % 1 + i0c = 0 % (-1) + i2a = 4 % 2 + i2b = (-4) % (-2) + im2a = (-4) % 2 + im2b = 4 % (-2) + i_pi = 22 % 7 + i_misc = 2 % 10000 + + r0a, r0b, r0c, r2a, r2b, rm2a, rm2b, r_pi, r_misc :: Rational + + r0a = 0 % 1 + r0b = (-0) % 1 + r0c = 0 % (-1) + r2a = 4 % 2 + r2b = (-4) % (-2) + rm2a = (-4) % 2 + rm2b = 4 % (-2) + r_pi = 22 % 7 + r_misc = 2 % 10000 diff --git a/testsuite/tests/numeric/should_run/arith002.stdout b/testsuite/tests/numeric/should_run/arith002.stdout new file mode 100644 index 0000000000..ab717549fd --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith002.stdout @@ -0,0 +1,4 @@ +[0 % 1,0 % 1,0 % 1,2 % 1,2 % 1,(-2) % 1,(-2) % 1,22 % 7,1 % 5000] +[0,0,0,2,2,-2,-2,22,1,1,1,1,1,1,1,1,7,5000] +[0 % 1,0 % 1,0 % 1,2 % 1,2 % 1,(-2) % 1,(-2) % 1,22 % 7,1 % 5000] +[0,0,0,2,2,-2,-2,22,1,1,1,1,1,1,1,1,7,5000] diff --git a/testsuite/tests/numeric/should_run/arith002.stdout-ghc b/testsuite/tests/numeric/should_run/arith002.stdout-ghc new file mode 100644 index 0000000000..ab717549fd --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith002.stdout-ghc @@ -0,0 +1,4 @@ +[0 % 1,0 % 1,0 % 1,2 % 1,2 % 1,(-2) % 1,(-2) % 1,22 % 7,1 % 5000] +[0,0,0,2,2,-2,-2,22,1,1,1,1,1,1,1,1,7,5000] +[0 % 1,0 % 1,0 % 1,2 % 1,2 % 1,(-2) % 1,(-2) % 1,22 % 7,1 % 5000] +[0,0,0,2,2,-2,-2,22,1,1,1,1,1,1,1,1,7,5000] diff --git a/testsuite/tests/numeric/should_run/arith003.hs b/testsuite/tests/numeric/should_run/arith003.hs new file mode 100644 index 0000000000..46f008120a --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith003.hs @@ -0,0 +1,84 @@ +-- $Id: arith003.hs,v 1.2 2002/01/25 13:40:39 simonmar Exp $ +-- +-- !!! test Int/Integer arithmetic operations from the Prelude. +-- + +main + = putStr + ( + showit (do_ops int_ops) ++ + showit (do_ops integer_ops) + ) + +showit :: Integral a => [(String, a, a, a)] -> String +showit stuff = concat + [ str ++ " " ++ show l ++ " " ++ show r ++ " = " ++ show result ++ "\n" + | (str, l, r, result) <- stuff + ] + +do_ops :: Integral a => [((a -> a -> a), String, [(a,a)])] + -> [(String, a, a, a)] +do_ops ops = [ (str, l, r, l `op` r) | (op,str,args) <- ops, (l,r) <- args ] + +small_operands, non_min_operands, operands, non_max_operands + :: Integral a => [a] +small_operands = [ 0, 1, -1, 2, -2 ] +operands = small_operands ++ [ fromIntegral minInt, fromIntegral maxInt ] +non_min_operands = small_operands ++ [ fromIntegral maxInt ] +non_max_operands = small_operands ++ [ fromIntegral minInt ] + +large_operands :: [ Integer ] +large_operands = operands ++ + [ fromIntegral minInt - 1, + fromIntegral maxInt + 1, + fromIntegral minInt * 2, + fromIntegral maxInt * 2, + fromIntegral minInt ^ 2, + fromIntegral maxInt ^ 2 + ] + +integer_ops :: [((Integer -> Integer -> Integer), String, [(Integer,Integer)])] +integer_ops = [ + ((+), "(+)", both_large), + ((-), "(-)", both_large), + (div, "div", large_non_zero_r), + (mod, "mod", large_non_zero_r), + (quot, "quot", large_non_zero_r), + (rem, "rem", large_non_zero_r), + (gcd, "gcd", large_either_non_zero), + (lcm, "lcm", large_either_non_zero) + ] + +int_ops :: [((Int -> Int -> Int), String, [(Int,Int)])] +int_ops = [ + ((+), "(+)", both_small), + ((-), "(-)", both_small), + ((^), "(^)", small_non_neg_r), + (div, "div", non_min_l_or_zero_r), + (mod, "mod", non_min_l_or_zero_r), + (quot, "quot", non_min_l_or_zero_r), + (rem, "rem", non_min_l_or_zero_r), + (gcd, "gcd", non_min_either_non_zero), + (lcm, "lcm", non_max_r_either_non_zero) + ] + +-- NOTE: when abs(minInt) is undefined (it is in GHC, because +-- abs(minInt) would be greater than maxInt), then gcd on Ints is also +-- undefined when either operand is minInt. + +both_small, non_zero_r, non_min_either_non_zero, non_min_l_or_zero_r, + non_max_r_either_non_zero, small_non_neg_r + :: Integral a => [(a,a)] + +both_small = [ (l,r) | l <- operands, r <- operands ] +both_large = [ (l,r) | l <- large_operands, r <- large_operands ] +large_non_zero_r = [ (l,r) | l <- operands, r <- large_operands, r /= 0 ] +non_zero_r = [ (l,r) | l <- operands, r <- operands, r /= 0 ] +non_min_either_non_zero = [ (l,r) | l <- non_min_operands, r <- non_min_operands, l /= 0 || r /= 0 ] +large_either_non_zero = [ (l,r) | l <- operands, r <- operands, l /= 0 || r /= 0 ] +small_non_neg_r = [ (l,r) | l <- operands, r <- small_operands, r >= 0 ] +non_min_l_or_zero_r = [ (l,r) | l <- non_min_operands, r <- operands, r /= 0 ] +non_max_r_either_non_zero = [ (l,r) | l <- operands, r <- non_max_operands, l /= 0 || r /= 0 ] + +minInt = minBound :: Int +maxInt = maxBound :: Int diff --git a/testsuite/tests/numeric/should_run/arith003.stdout b/testsuite/tests/numeric/should_run/arith003.stdout new file mode 100644 index 0000000000..a147c3003c --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith003.stdout @@ -0,0 +1,1109 @@ +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -2147483648 = -2147483648 +(+) 0 2147483647 = 2147483647 +(+) 1 0 = 1 +(+) 1 1 = 2 +(+) 1 -1 = 0 +(+) 1 2 = 3 +(+) 1 -2 = -1 +(+) 1 -2147483648 = -2147483647 +(+) 1 2147483647 = -2147483648 +(+) -1 0 = -1 +(+) -1 1 = 0 +(+) -1 -1 = -2 +(+) -1 2 = 1 +(+) -1 -2 = -3 +(+) -1 -2147483648 = 2147483647 +(+) -1 2147483647 = 2147483646 +(+) 2 0 = 2 +(+) 2 1 = 3 +(+) 2 -1 = 1 +(+) 2 2 = 4 +(+) 2 -2 = 0 +(+) 2 -2147483648 = -2147483646 +(+) 2 2147483647 = -2147483647 +(+) -2 0 = -2 +(+) -2 1 = -1 +(+) -2 -1 = -3 +(+) -2 2 = 0 +(+) -2 -2 = -4 +(+) -2 -2147483648 = 2147483646 +(+) -2 2147483647 = 2147483645 +(+) -2147483648 0 = -2147483648 +(+) -2147483648 1 = -2147483647 +(+) -2147483648 -1 = 2147483647 +(+) -2147483648 2 = -2147483646 +(+) -2147483648 -2 = 2147483646 +(+) -2147483648 -2147483648 = 0 +(+) -2147483648 2147483647 = -1 +(+) 2147483647 0 = 2147483647 +(+) 2147483647 1 = -2147483648 +(+) 2147483647 -1 = 2147483646 +(+) 2147483647 2 = -2147483647 +(+) 2147483647 -2 = 2147483645 +(+) 2147483647 -2147483648 = -1 +(+) 2147483647 2147483647 = -2 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -2147483648 = -2147483648 +(-) 0 2147483647 = -2147483647 +(-) 1 0 = 1 +(-) 1 1 = 0 +(-) 1 -1 = 2 +(-) 1 2 = -1 +(-) 1 -2 = 3 +(-) 1 -2147483648 = -2147483647 +(-) 1 2147483647 = -2147483646 +(-) -1 0 = -1 +(-) -1 1 = -2 +(-) -1 -1 = 0 +(-) -1 2 = -3 +(-) -1 -2 = 1 +(-) -1 -2147483648 = 2147483647 +(-) -1 2147483647 = -2147483648 +(-) 2 0 = 2 +(-) 2 1 = 1 +(-) 2 -1 = 3 +(-) 2 2 = 0 +(-) 2 -2 = 4 +(-) 2 -2147483648 = -2147483646 +(-) 2 2147483647 = -2147483645 +(-) -2 0 = -2 +(-) -2 1 = -3 +(-) -2 -1 = -1 +(-) -2 2 = -4 +(-) -2 -2 = 0 +(-) -2 -2147483648 = 2147483646 +(-) -2 2147483647 = 2147483647 +(-) -2147483648 0 = -2147483648 +(-) -2147483648 1 = 2147483647 +(-) -2147483648 -1 = -2147483647 +(-) -2147483648 2 = 2147483646 +(-) -2147483648 -2 = -2147483646 +(-) -2147483648 -2147483648 = 0 +(-) -2147483648 2147483647 = 1 +(-) 2147483647 0 = 2147483647 +(-) 2147483647 1 = 2147483646 +(-) 2147483647 -1 = -2147483648 +(-) 2147483647 2 = 2147483645 +(-) 2147483647 -2 = -2147483647 +(-) 2147483647 -2147483648 = -1 +(-) 2147483647 2147483647 = 0 +(^) 0 0 = 1 +(^) 0 1 = 0 +(^) 0 2 = 0 +(^) 1 0 = 1 +(^) 1 1 = 1 +(^) 1 2 = 1 +(^) -1 0 = 1 +(^) -1 1 = -1 +(^) -1 2 = 1 +(^) 2 0 = 1 +(^) 2 1 = 2 +(^) 2 2 = 4 +(^) -2 0 = 1 +(^) -2 1 = -2 +(^) -2 2 = 4 +(^) -2147483648 0 = 1 +(^) -2147483648 1 = -2147483648 +(^) -2147483648 2 = 0 +(^) 2147483647 0 = 1 +(^) 2147483647 1 = 2147483647 +(^) 2147483647 2 = 1 +div 0 1 = 0 +div 0 -1 = 0 +div 0 2 = 0 +div 0 -2 = 0 +div 0 -2147483648 = 0 +div 0 2147483647 = 0 +div 1 1 = 1 +div 1 -1 = -1 +div 1 2 = 0 +div 1 -2 = -1 +div 1 -2147483648 = -1 +div 1 2147483647 = 0 +div -1 1 = -1 +div -1 -1 = 1 +div -1 2 = -1 +div -1 -2 = 0 +div -1 -2147483648 = 0 +div -1 2147483647 = -1 +div 2 1 = 2 +div 2 -1 = -2 +div 2 2 = 1 +div 2 -2 = -1 +div 2 -2147483648 = -1 +div 2 2147483647 = 0 +div -2 1 = -2 +div -2 -1 = 2 +div -2 2 = -1 +div -2 -2 = 1 +div -2 -2147483648 = 0 +div -2 2147483647 = -1 +div 2147483647 1 = 2147483647 +div 2147483647 -1 = -2147483647 +div 2147483647 2 = 1073741823 +div 2147483647 -2 = -1073741824 +div 2147483647 -2147483648 = -1 +div 2147483647 2147483647 = 1 +mod 0 1 = 0 +mod 0 -1 = 0 +mod 0 2 = 0 +mod 0 -2 = 0 +mod 0 -2147483648 = 0 +mod 0 2147483647 = 0 +mod 1 1 = 0 +mod 1 -1 = 0 +mod 1 2 = 1 +mod 1 -2 = -1 +mod 1 -2147483648 = -2147483647 +mod 1 2147483647 = 1 +mod -1 1 = 0 +mod -1 -1 = 0 +mod -1 2 = 1 +mod -1 -2 = -1 +mod -1 -2147483648 = -1 +mod -1 2147483647 = 2147483646 +mod 2 1 = 0 +mod 2 -1 = 0 +mod 2 2 = 0 +mod 2 -2 = 0 +mod 2 -2147483648 = -2147483646 +mod 2 2147483647 = 2 +mod -2 1 = 0 +mod -2 -1 = 0 +mod -2 2 = 0 +mod -2 -2 = 0 +mod -2 -2147483648 = -2 +mod -2 2147483647 = 2147483645 +mod 2147483647 1 = 0 +mod 2147483647 -1 = 0 +mod 2147483647 2 = 1 +mod 2147483647 -2 = -1 +mod 2147483647 -2147483648 = -1 +mod 2147483647 2147483647 = 0 +quot 0 1 = 0 +quot 0 -1 = 0 +quot 0 2 = 0 +quot 0 -2 = 0 +quot 0 -2147483648 = 0 +quot 0 2147483647 = 0 +quot 1 1 = 1 +quot 1 -1 = -1 +quot 1 2 = 0 +quot 1 -2 = 0 +quot 1 -2147483648 = 0 +quot 1 2147483647 = 0 +quot -1 1 = -1 +quot -1 -1 = 1 +quot -1 2 = 0 +quot -1 -2 = 0 +quot -1 -2147483648 = 0 +quot -1 2147483647 = 0 +quot 2 1 = 2 +quot 2 -1 = -2 +quot 2 2 = 1 +quot 2 -2 = -1 +quot 2 -2147483648 = 0 +quot 2 2147483647 = 0 +quot -2 1 = -2 +quot -2 -1 = 2 +quot -2 2 = -1 +quot -2 -2 = 1 +quot -2 -2147483648 = 0 +quot -2 2147483647 = 0 +quot 2147483647 1 = 2147483647 +quot 2147483647 -1 = -2147483647 +quot 2147483647 2 = 1073741823 +quot 2147483647 -2 = -1073741823 +quot 2147483647 -2147483648 = 0 +quot 2147483647 2147483647 = 1 +rem 0 1 = 0 +rem 0 -1 = 0 +rem 0 2 = 0 +rem 0 -2 = 0 +rem 0 -2147483648 = 0 +rem 0 2147483647 = 0 +rem 1 1 = 0 +rem 1 -1 = 0 +rem 1 2 = 1 +rem 1 -2 = 1 +rem 1 -2147483648 = 1 +rem 1 2147483647 = 1 +rem -1 1 = 0 +rem -1 -1 = 0 +rem -1 2 = -1 +rem -1 -2 = -1 +rem -1 -2147483648 = -1 +rem -1 2147483647 = -1 +rem 2 1 = 0 +rem 2 -1 = 0 +rem 2 2 = 0 +rem 2 -2 = 0 +rem 2 -2147483648 = 2 +rem 2 2147483647 = 2 +rem -2 1 = 0 +rem -2 -1 = 0 +rem -2 2 = 0 +rem -2 -2 = 0 +rem -2 -2147483648 = -2 +rem -2 2147483647 = -2 +rem 2147483647 1 = 0 +rem 2147483647 -1 = 0 +rem 2147483647 2 = 1 +rem 2147483647 -2 = 1 +rem 2147483647 -2147483648 = 2147483647 +rem 2147483647 2147483647 = 0 +gcd 0 1 = 1 +gcd 0 -1 = 1 +gcd 0 2 = 2 +gcd 0 -2 = 2 +gcd 0 2147483647 = 2147483647 +gcd 1 0 = 1 +gcd 1 1 = 1 +gcd 1 -1 = 1 +gcd 1 2 = 1 +gcd 1 -2 = 1 +gcd 1 2147483647 = 1 +gcd -1 0 = 1 +gcd -1 1 = 1 +gcd -1 -1 = 1 +gcd -1 2 = 1 +gcd -1 -2 = 1 +gcd -1 2147483647 = 1 +gcd 2 0 = 2 +gcd 2 1 = 1 +gcd 2 -1 = 1 +gcd 2 2 = 2 +gcd 2 -2 = 2 +gcd 2 2147483647 = 1 +gcd -2 0 = 2 +gcd -2 1 = 1 +gcd -2 -1 = 1 +gcd -2 2 = 2 +gcd -2 -2 = 2 +gcd -2 2147483647 = 1 +gcd 2147483647 0 = 2147483647 +gcd 2147483647 1 = 1 +gcd 2147483647 -1 = 1 +gcd 2147483647 2 = 1 +gcd 2147483647 -2 = 1 +gcd 2147483647 2147483647 = 2147483647 +lcm 0 1 = 0 +lcm 0 -1 = 0 +lcm 0 2 = 0 +lcm 0 -2 = 0 +lcm 0 -2147483648 = 0 +lcm 1 0 = 0 +lcm 1 1 = 1 +lcm 1 -1 = 1 +lcm 1 2 = 2 +lcm 1 -2 = 2 +lcm 1 -2147483648 = -2147483648 +lcm -1 0 = 0 +lcm -1 1 = 1 +lcm -1 -1 = 1 +lcm -1 2 = 2 +lcm -1 -2 = 2 +lcm -1 -2147483648 = -2147483648 +lcm 2 0 = 0 +lcm 2 1 = 2 +lcm 2 -1 = 2 +lcm 2 2 = 2 +lcm 2 -2 = 2 +lcm 2 -2147483648 = -2147483648 +lcm -2 0 = 0 +lcm -2 1 = 2 +lcm -2 -1 = 2 +lcm -2 2 = 2 +lcm -2 -2 = 2 +lcm -2 -2147483648 = -2147483648 +lcm -2147483648 0 = 0 +lcm -2147483648 1 = -2147483648 +lcm -2147483648 -1 = -2147483648 +lcm -2147483648 2 = -2147483648 +lcm -2147483648 -2 = -2147483648 +lcm -2147483648 -2147483648 = -2147483648 +lcm 2147483647 0 = 0 +lcm 2147483647 1 = 2147483647 +lcm 2147483647 -1 = 2147483647 +lcm 2147483647 2 = 2 +lcm 2147483647 -2 = 2 +lcm 2147483647 -2147483648 = -2147483648 +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -2147483648 = -2147483648 +(+) 0 2147483647 = 2147483647 +(+) 0 -2147483649 = -2147483649 +(+) 0 2147483648 = 2147483648 +(+) 0 -4294967296 = -4294967296 +(+) 0 4294967294 = 4294967294 +(+) 0 4611686018427387904 = 4611686018427387904 +(+) 0 4611686014132420609 = 4611686014132420609 +(+) 1 0 = 1 +(+) 1 1 = 2 +(+) 1 -1 = 0 +(+) 1 2 = 3 +(+) 1 -2 = -1 +(+) 1 -2147483648 = -2147483647 +(+) 1 2147483647 = 2147483648 +(+) 1 -2147483649 = -2147483648 +(+) 1 2147483648 = 2147483649 +(+) 1 -4294967296 = -4294967295 +(+) 1 4294967294 = 4294967295 +(+) 1 4611686018427387904 = 4611686018427387905 +(+) 1 4611686014132420609 = 4611686014132420610 +(+) -1 0 = -1 +(+) -1 1 = 0 +(+) -1 -1 = -2 +(+) -1 2 = 1 +(+) -1 -2 = -3 +(+) -1 -2147483648 = -2147483649 +(+) -1 2147483647 = 2147483646 +(+) -1 -2147483649 = -2147483650 +(+) -1 2147483648 = 2147483647 +(+) -1 -4294967296 = -4294967297 +(+) -1 4294967294 = 4294967293 +(+) -1 4611686018427387904 = 4611686018427387903 +(+) -1 4611686014132420609 = 4611686014132420608 +(+) 2 0 = 2 +(+) 2 1 = 3 +(+) 2 -1 = 1 +(+) 2 2 = 4 +(+) 2 -2 = 0 +(+) 2 -2147483648 = -2147483646 +(+) 2 2147483647 = 2147483649 +(+) 2 -2147483649 = -2147483647 +(+) 2 2147483648 = 2147483650 +(+) 2 -4294967296 = -4294967294 +(+) 2 4294967294 = 4294967296 +(+) 2 4611686018427387904 = 4611686018427387906 +(+) 2 4611686014132420609 = 4611686014132420611 +(+) -2 0 = -2 +(+) -2 1 = -1 +(+) -2 -1 = -3 +(+) -2 2 = 0 +(+) -2 -2 = -4 +(+) -2 -2147483648 = -2147483650 +(+) -2 2147483647 = 2147483645 +(+) -2 -2147483649 = -2147483651 +(+) -2 2147483648 = 2147483646 +(+) -2 -4294967296 = -4294967298 +(+) -2 4294967294 = 4294967292 +(+) -2 4611686018427387904 = 4611686018427387902 +(+) -2 4611686014132420609 = 4611686014132420607 +(+) -2147483648 0 = -2147483648 +(+) -2147483648 1 = -2147483647 +(+) -2147483648 -1 = -2147483649 +(+) -2147483648 2 = -2147483646 +(+) -2147483648 -2 = -2147483650 +(+) -2147483648 -2147483648 = -4294967296 +(+) -2147483648 2147483647 = -1 +(+) -2147483648 -2147483649 = -4294967297 +(+) -2147483648 2147483648 = 0 +(+) -2147483648 -4294967296 = -6442450944 +(+) -2147483648 4294967294 = 2147483646 +(+) -2147483648 4611686018427387904 = 4611686016279904256 +(+) -2147483648 4611686014132420609 = 4611686011984936961 +(+) 2147483647 0 = 2147483647 +(+) 2147483647 1 = 2147483648 +(+) 2147483647 -1 = 2147483646 +(+) 2147483647 2 = 2147483649 +(+) 2147483647 -2 = 2147483645 +(+) 2147483647 -2147483648 = -1 +(+) 2147483647 2147483647 = 4294967294 +(+) 2147483647 -2147483649 = -2 +(+) 2147483647 2147483648 = 4294967295 +(+) 2147483647 -4294967296 = -2147483649 +(+) 2147483647 4294967294 = 6442450941 +(+) 2147483647 4611686018427387904 = 4611686020574871551 +(+) 2147483647 4611686014132420609 = 4611686016279904256 +(+) -2147483649 0 = -2147483649 +(+) -2147483649 1 = -2147483648 +(+) -2147483649 -1 = -2147483650 +(+) -2147483649 2 = -2147483647 +(+) -2147483649 -2 = -2147483651 +(+) -2147483649 -2147483648 = -4294967297 +(+) -2147483649 2147483647 = -2 +(+) -2147483649 -2147483649 = -4294967298 +(+) -2147483649 2147483648 = -1 +(+) -2147483649 -4294967296 = -6442450945 +(+) -2147483649 4294967294 = 2147483645 +(+) -2147483649 4611686018427387904 = 4611686016279904255 +(+) -2147483649 4611686014132420609 = 4611686011984936960 +(+) 2147483648 0 = 2147483648 +(+) 2147483648 1 = 2147483649 +(+) 2147483648 -1 = 2147483647 +(+) 2147483648 2 = 2147483650 +(+) 2147483648 -2 = 2147483646 +(+) 2147483648 -2147483648 = 0 +(+) 2147483648 2147483647 = 4294967295 +(+) 2147483648 -2147483649 = -1 +(+) 2147483648 2147483648 = 4294967296 +(+) 2147483648 -4294967296 = -2147483648 +(+) 2147483648 4294967294 = 6442450942 +(+) 2147483648 4611686018427387904 = 4611686020574871552 +(+) 2147483648 4611686014132420609 = 4611686016279904257 +(+) -4294967296 0 = -4294967296 +(+) -4294967296 1 = -4294967295 +(+) -4294967296 -1 = -4294967297 +(+) -4294967296 2 = -4294967294 +(+) -4294967296 -2 = -4294967298 +(+) -4294967296 -2147483648 = -6442450944 +(+) -4294967296 2147483647 = -2147483649 +(+) -4294967296 -2147483649 = -6442450945 +(+) -4294967296 2147483648 = -2147483648 +(+) -4294967296 -4294967296 = -8589934592 +(+) -4294967296 4294967294 = -2 +(+) -4294967296 4611686018427387904 = 4611686014132420608 +(+) -4294967296 4611686014132420609 = 4611686009837453313 +(+) 4294967294 0 = 4294967294 +(+) 4294967294 1 = 4294967295 +(+) 4294967294 -1 = 4294967293 +(+) 4294967294 2 = 4294967296 +(+) 4294967294 -2 = 4294967292 +(+) 4294967294 -2147483648 = 2147483646 +(+) 4294967294 2147483647 = 6442450941 +(+) 4294967294 -2147483649 = 2147483645 +(+) 4294967294 2147483648 = 6442450942 +(+) 4294967294 -4294967296 = -2 +(+) 4294967294 4294967294 = 8589934588 +(+) 4294967294 4611686018427387904 = 4611686022722355198 +(+) 4294967294 4611686014132420609 = 4611686018427387903 +(+) 4611686018427387904 0 = 4611686018427387904 +(+) 4611686018427387904 1 = 4611686018427387905 +(+) 4611686018427387904 -1 = 4611686018427387903 +(+) 4611686018427387904 2 = 4611686018427387906 +(+) 4611686018427387904 -2 = 4611686018427387902 +(+) 4611686018427387904 -2147483648 = 4611686016279904256 +(+) 4611686018427387904 2147483647 = 4611686020574871551 +(+) 4611686018427387904 -2147483649 = 4611686016279904255 +(+) 4611686018427387904 2147483648 = 4611686020574871552 +(+) 4611686018427387904 -4294967296 = 4611686014132420608 +(+) 4611686018427387904 4294967294 = 4611686022722355198 +(+) 4611686018427387904 4611686018427387904 = 9223372036854775808 +(+) 4611686018427387904 4611686014132420609 = 9223372032559808513 +(+) 4611686014132420609 0 = 4611686014132420609 +(+) 4611686014132420609 1 = 4611686014132420610 +(+) 4611686014132420609 -1 = 4611686014132420608 +(+) 4611686014132420609 2 = 4611686014132420611 +(+) 4611686014132420609 -2 = 4611686014132420607 +(+) 4611686014132420609 -2147483648 = 4611686011984936961 +(+) 4611686014132420609 2147483647 = 4611686016279904256 +(+) 4611686014132420609 -2147483649 = 4611686011984936960 +(+) 4611686014132420609 2147483648 = 4611686016279904257 +(+) 4611686014132420609 -4294967296 = 4611686009837453313 +(+) 4611686014132420609 4294967294 = 4611686018427387903 +(+) 4611686014132420609 4611686018427387904 = 9223372032559808513 +(+) 4611686014132420609 4611686014132420609 = 9223372028264841218 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -2147483648 = 2147483648 +(-) 0 2147483647 = -2147483647 +(-) 0 -2147483649 = 2147483649 +(-) 0 2147483648 = -2147483648 +(-) 0 -4294967296 = 4294967296 +(-) 0 4294967294 = -4294967294 +(-) 0 4611686018427387904 = -4611686018427387904 +(-) 0 4611686014132420609 = -4611686014132420609 +(-) 1 0 = 1 +(-) 1 1 = 0 +(-) 1 -1 = 2 +(-) 1 2 = -1 +(-) 1 -2 = 3 +(-) 1 -2147483648 = 2147483649 +(-) 1 2147483647 = -2147483646 +(-) 1 -2147483649 = 2147483650 +(-) 1 2147483648 = -2147483647 +(-) 1 -4294967296 = 4294967297 +(-) 1 4294967294 = -4294967293 +(-) 1 4611686018427387904 = -4611686018427387903 +(-) 1 4611686014132420609 = -4611686014132420608 +(-) -1 0 = -1 +(-) -1 1 = -2 +(-) -1 -1 = 0 +(-) -1 2 = -3 +(-) -1 -2 = 1 +(-) -1 -2147483648 = 2147483647 +(-) -1 2147483647 = -2147483648 +(-) -1 -2147483649 = 2147483648 +(-) -1 2147483648 = -2147483649 +(-) -1 -4294967296 = 4294967295 +(-) -1 4294967294 = -4294967295 +(-) -1 4611686018427387904 = -4611686018427387905 +(-) -1 4611686014132420609 = -4611686014132420610 +(-) 2 0 = 2 +(-) 2 1 = 1 +(-) 2 -1 = 3 +(-) 2 2 = 0 +(-) 2 -2 = 4 +(-) 2 -2147483648 = 2147483650 +(-) 2 2147483647 = -2147483645 +(-) 2 -2147483649 = 2147483651 +(-) 2 2147483648 = -2147483646 +(-) 2 -4294967296 = 4294967298 +(-) 2 4294967294 = -4294967292 +(-) 2 4611686018427387904 = -4611686018427387902 +(-) 2 4611686014132420609 = -4611686014132420607 +(-) -2 0 = -2 +(-) -2 1 = -3 +(-) -2 -1 = -1 +(-) -2 2 = -4 +(-) -2 -2 = 0 +(-) -2 -2147483648 = 2147483646 +(-) -2 2147483647 = -2147483649 +(-) -2 -2147483649 = 2147483647 +(-) -2 2147483648 = -2147483650 +(-) -2 -4294967296 = 4294967294 +(-) -2 4294967294 = -4294967296 +(-) -2 4611686018427387904 = -4611686018427387906 +(-) -2 4611686014132420609 = -4611686014132420611 +(-) -2147483648 0 = -2147483648 +(-) -2147483648 1 = -2147483649 +(-) -2147483648 -1 = -2147483647 +(-) -2147483648 2 = -2147483650 +(-) -2147483648 -2 = -2147483646 +(-) -2147483648 -2147483648 = 0 +(-) -2147483648 2147483647 = -4294967295 +(-) -2147483648 -2147483649 = 1 +(-) -2147483648 2147483648 = -4294967296 +(-) -2147483648 -4294967296 = 2147483648 +(-) -2147483648 4294967294 = -6442450942 +(-) -2147483648 4611686018427387904 = -4611686020574871552 +(-) -2147483648 4611686014132420609 = -4611686016279904257 +(-) 2147483647 0 = 2147483647 +(-) 2147483647 1 = 2147483646 +(-) 2147483647 -1 = 2147483648 +(-) 2147483647 2 = 2147483645 +(-) 2147483647 -2 = 2147483649 +(-) 2147483647 -2147483648 = 4294967295 +(-) 2147483647 2147483647 = 0 +(-) 2147483647 -2147483649 = 4294967296 +(-) 2147483647 2147483648 = -1 +(-) 2147483647 -4294967296 = 6442450943 +(-) 2147483647 4294967294 = -2147483647 +(-) 2147483647 4611686018427387904 = -4611686016279904257 +(-) 2147483647 4611686014132420609 = -4611686011984936962 +(-) -2147483649 0 = -2147483649 +(-) -2147483649 1 = -2147483650 +(-) -2147483649 -1 = -2147483648 +(-) -2147483649 2 = -2147483651 +(-) -2147483649 -2 = -2147483647 +(-) -2147483649 -2147483648 = -1 +(-) -2147483649 2147483647 = -4294967296 +(-) -2147483649 -2147483649 = 0 +(-) -2147483649 2147483648 = -4294967297 +(-) -2147483649 -4294967296 = 2147483647 +(-) -2147483649 4294967294 = -6442450943 +(-) -2147483649 4611686018427387904 = -4611686020574871553 +(-) -2147483649 4611686014132420609 = -4611686016279904258 +(-) 2147483648 0 = 2147483648 +(-) 2147483648 1 = 2147483647 +(-) 2147483648 -1 = 2147483649 +(-) 2147483648 2 = 2147483646 +(-) 2147483648 -2 = 2147483650 +(-) 2147483648 -2147483648 = 4294967296 +(-) 2147483648 2147483647 = 1 +(-) 2147483648 -2147483649 = 4294967297 +(-) 2147483648 2147483648 = 0 +(-) 2147483648 -4294967296 = 6442450944 +(-) 2147483648 4294967294 = -2147483646 +(-) 2147483648 4611686018427387904 = -4611686016279904256 +(-) 2147483648 4611686014132420609 = -4611686011984936961 +(-) -4294967296 0 = -4294967296 +(-) -4294967296 1 = -4294967297 +(-) -4294967296 -1 = -4294967295 +(-) -4294967296 2 = -4294967298 +(-) -4294967296 -2 = -4294967294 +(-) -4294967296 -2147483648 = -2147483648 +(-) -4294967296 2147483647 = -6442450943 +(-) -4294967296 -2147483649 = -2147483647 +(-) -4294967296 2147483648 = -6442450944 +(-) -4294967296 -4294967296 = 0 +(-) -4294967296 4294967294 = -8589934590 +(-) -4294967296 4611686018427387904 = -4611686022722355200 +(-) -4294967296 4611686014132420609 = -4611686018427387905 +(-) 4294967294 0 = 4294967294 +(-) 4294967294 1 = 4294967293 +(-) 4294967294 -1 = 4294967295 +(-) 4294967294 2 = 4294967292 +(-) 4294967294 -2 = 4294967296 +(-) 4294967294 -2147483648 = 6442450942 +(-) 4294967294 2147483647 = 2147483647 +(-) 4294967294 -2147483649 = 6442450943 +(-) 4294967294 2147483648 = 2147483646 +(-) 4294967294 -4294967296 = 8589934590 +(-) 4294967294 4294967294 = 0 +(-) 4294967294 4611686018427387904 = -4611686014132420610 +(-) 4294967294 4611686014132420609 = -4611686009837453315 +(-) 4611686018427387904 0 = 4611686018427387904 +(-) 4611686018427387904 1 = 4611686018427387903 +(-) 4611686018427387904 -1 = 4611686018427387905 +(-) 4611686018427387904 2 = 4611686018427387902 +(-) 4611686018427387904 -2 = 4611686018427387906 +(-) 4611686018427387904 -2147483648 = 4611686020574871552 +(-) 4611686018427387904 2147483647 = 4611686016279904257 +(-) 4611686018427387904 -2147483649 = 4611686020574871553 +(-) 4611686018427387904 2147483648 = 4611686016279904256 +(-) 4611686018427387904 -4294967296 = 4611686022722355200 +(-) 4611686018427387904 4294967294 = 4611686014132420610 +(-) 4611686018427387904 4611686018427387904 = 0 +(-) 4611686018427387904 4611686014132420609 = 4294967295 +(-) 4611686014132420609 0 = 4611686014132420609 +(-) 4611686014132420609 1 = 4611686014132420608 +(-) 4611686014132420609 -1 = 4611686014132420610 +(-) 4611686014132420609 2 = 4611686014132420607 +(-) 4611686014132420609 -2 = 4611686014132420611 +(-) 4611686014132420609 -2147483648 = 4611686016279904257 +(-) 4611686014132420609 2147483647 = 4611686011984936962 +(-) 4611686014132420609 -2147483649 = 4611686016279904258 +(-) 4611686014132420609 2147483648 = 4611686011984936961 +(-) 4611686014132420609 -4294967296 = 4611686018427387905 +(-) 4611686014132420609 4294967294 = 4611686009837453315 +(-) 4611686014132420609 4611686018427387904 = -4294967295 +(-) 4611686014132420609 4611686014132420609 = 0 +div 0 1 = 0 +div 0 -1 = 0 +div 0 2 = 0 +div 0 -2 = 0 +div 0 -2147483648 = 0 +div 0 2147483647 = 0 +div 0 -2147483649 = 0 +div 0 2147483648 = 0 +div 0 -4294967296 = 0 +div 0 4294967294 = 0 +div 0 4611686018427387904 = 0 +div 0 4611686014132420609 = 0 +div 1 1 = 1 +div 1 -1 = -1 +div 1 2 = 0 +div 1 -2 = -1 +div 1 -2147483648 = -1 +div 1 2147483647 = 0 +div 1 -2147483649 = -1 +div 1 2147483648 = 0 +div 1 -4294967296 = -1 +div 1 4294967294 = 0 +div 1 4611686018427387904 = 0 +div 1 4611686014132420609 = 0 +div -1 1 = -1 +div -1 -1 = 1 +div -1 2 = -1 +div -1 -2 = 0 +div -1 -2147483648 = 0 +div -1 2147483647 = -1 +div -1 -2147483649 = 0 +div -1 2147483648 = -1 +div -1 -4294967296 = 0 +div -1 4294967294 = -1 +div -1 4611686018427387904 = -1 +div -1 4611686014132420609 = -1 +div 2 1 = 2 +div 2 -1 = -2 +div 2 2 = 1 +div 2 -2 = -1 +div 2 -2147483648 = -1 +div 2 2147483647 = 0 +div 2 -2147483649 = -1 +div 2 2147483648 = 0 +div 2 -4294967296 = -1 +div 2 4294967294 = 0 +div 2 4611686018427387904 = 0 +div 2 4611686014132420609 = 0 +div -2 1 = -2 +div -2 -1 = 2 +div -2 2 = -1 +div -2 -2 = 1 +div -2 -2147483648 = 0 +div -2 2147483647 = -1 +div -2 -2147483649 = 0 +div -2 2147483648 = -1 +div -2 -4294967296 = 0 +div -2 4294967294 = -1 +div -2 4611686018427387904 = -1 +div -2 4611686014132420609 = -1 +div -2147483648 1 = -2147483648 +div -2147483648 -1 = 2147483648 +div -2147483648 2 = -1073741824 +div -2147483648 -2 = 1073741824 +div -2147483648 -2147483648 = 1 +div -2147483648 2147483647 = -2 +div -2147483648 -2147483649 = 0 +div -2147483648 2147483648 = -1 +div -2147483648 -4294967296 = 0 +div -2147483648 4294967294 = -1 +div -2147483648 4611686018427387904 = -1 +div -2147483648 4611686014132420609 = -1 +div 2147483647 1 = 2147483647 +div 2147483647 -1 = -2147483647 +div 2147483647 2 = 1073741823 +div 2147483647 -2 = -1073741824 +div 2147483647 -2147483648 = -1 +div 2147483647 2147483647 = 1 +div 2147483647 -2147483649 = -1 +div 2147483647 2147483648 = 0 +div 2147483647 -4294967296 = -1 +div 2147483647 4294967294 = 0 +div 2147483647 4611686018427387904 = 0 +div 2147483647 4611686014132420609 = 0 +mod 0 1 = 0 +mod 0 -1 = 0 +mod 0 2 = 0 +mod 0 -2 = 0 +mod 0 -2147483648 = 0 +mod 0 2147483647 = 0 +mod 0 -2147483649 = 0 +mod 0 2147483648 = 0 +mod 0 -4294967296 = 0 +mod 0 4294967294 = 0 +mod 0 4611686018427387904 = 0 +mod 0 4611686014132420609 = 0 +mod 1 1 = 0 +mod 1 -1 = 0 +mod 1 2 = 1 +mod 1 -2 = -1 +mod 1 -2147483648 = -2147483647 +mod 1 2147483647 = 1 +mod 1 -2147483649 = -2147483648 +mod 1 2147483648 = 1 +mod 1 -4294967296 = -4294967295 +mod 1 4294967294 = 1 +mod 1 4611686018427387904 = 1 +mod 1 4611686014132420609 = 1 +mod -1 1 = 0 +mod -1 -1 = 0 +mod -1 2 = 1 +mod -1 -2 = -1 +mod -1 -2147483648 = -1 +mod -1 2147483647 = 2147483646 +mod -1 -2147483649 = -1 +mod -1 2147483648 = 2147483647 +mod -1 -4294967296 = -1 +mod -1 4294967294 = 4294967293 +mod -1 4611686018427387904 = 4611686018427387903 +mod -1 4611686014132420609 = 4611686014132420608 +mod 2 1 = 0 +mod 2 -1 = 0 +mod 2 2 = 0 +mod 2 -2 = 0 +mod 2 -2147483648 = -2147483646 +mod 2 2147483647 = 2 +mod 2 -2147483649 = -2147483647 +mod 2 2147483648 = 2 +mod 2 -4294967296 = -4294967294 +mod 2 4294967294 = 2 +mod 2 4611686018427387904 = 2 +mod 2 4611686014132420609 = 2 +mod -2 1 = 0 +mod -2 -1 = 0 +mod -2 2 = 0 +mod -2 -2 = 0 +mod -2 -2147483648 = -2 +mod -2 2147483647 = 2147483645 +mod -2 -2147483649 = -2 +mod -2 2147483648 = 2147483646 +mod -2 -4294967296 = -2 +mod -2 4294967294 = 4294967292 +mod -2 4611686018427387904 = 4611686018427387902 +mod -2 4611686014132420609 = 4611686014132420607 +mod -2147483648 1 = 0 +mod -2147483648 -1 = 0 +mod -2147483648 2 = 0 +mod -2147483648 -2 = 0 +mod -2147483648 -2147483648 = 0 +mod -2147483648 2147483647 = 2147483646 +mod -2147483648 -2147483649 = -2147483648 +mod -2147483648 2147483648 = 0 +mod -2147483648 -4294967296 = -2147483648 +mod -2147483648 4294967294 = 2147483646 +mod -2147483648 4611686018427387904 = 4611686016279904256 +mod -2147483648 4611686014132420609 = 4611686011984936961 +mod 2147483647 1 = 0 +mod 2147483647 -1 = 0 +mod 2147483647 2 = 1 +mod 2147483647 -2 = -1 +mod 2147483647 -2147483648 = -1 +mod 2147483647 2147483647 = 0 +mod 2147483647 -2147483649 = -2 +mod 2147483647 2147483648 = 2147483647 +mod 2147483647 -4294967296 = -2147483649 +mod 2147483647 4294967294 = 2147483647 +mod 2147483647 4611686018427387904 = 2147483647 +mod 2147483647 4611686014132420609 = 2147483647 +quot 0 1 = 0 +quot 0 -1 = 0 +quot 0 2 = 0 +quot 0 -2 = 0 +quot 0 -2147483648 = 0 +quot 0 2147483647 = 0 +quot 0 -2147483649 = 0 +quot 0 2147483648 = 0 +quot 0 -4294967296 = 0 +quot 0 4294967294 = 0 +quot 0 4611686018427387904 = 0 +quot 0 4611686014132420609 = 0 +quot 1 1 = 1 +quot 1 -1 = -1 +quot 1 2 = 0 +quot 1 -2 = 0 +quot 1 -2147483648 = 0 +quot 1 2147483647 = 0 +quot 1 -2147483649 = 0 +quot 1 2147483648 = 0 +quot 1 -4294967296 = 0 +quot 1 4294967294 = 0 +quot 1 4611686018427387904 = 0 +quot 1 4611686014132420609 = 0 +quot -1 1 = -1 +quot -1 -1 = 1 +quot -1 2 = 0 +quot -1 -2 = 0 +quot -1 -2147483648 = 0 +quot -1 2147483647 = 0 +quot -1 -2147483649 = 0 +quot -1 2147483648 = 0 +quot -1 -4294967296 = 0 +quot -1 4294967294 = 0 +quot -1 4611686018427387904 = 0 +quot -1 4611686014132420609 = 0 +quot 2 1 = 2 +quot 2 -1 = -2 +quot 2 2 = 1 +quot 2 -2 = -1 +quot 2 -2147483648 = 0 +quot 2 2147483647 = 0 +quot 2 -2147483649 = 0 +quot 2 2147483648 = 0 +quot 2 -4294967296 = 0 +quot 2 4294967294 = 0 +quot 2 4611686018427387904 = 0 +quot 2 4611686014132420609 = 0 +quot -2 1 = -2 +quot -2 -1 = 2 +quot -2 2 = -1 +quot -2 -2 = 1 +quot -2 -2147483648 = 0 +quot -2 2147483647 = 0 +quot -2 -2147483649 = 0 +quot -2 2147483648 = 0 +quot -2 -4294967296 = 0 +quot -2 4294967294 = 0 +quot -2 4611686018427387904 = 0 +quot -2 4611686014132420609 = 0 +quot -2147483648 1 = -2147483648 +quot -2147483648 -1 = 2147483648 +quot -2147483648 2 = -1073741824 +quot -2147483648 -2 = 1073741824 +quot -2147483648 -2147483648 = 1 +quot -2147483648 2147483647 = -1 +quot -2147483648 -2147483649 = 0 +quot -2147483648 2147483648 = -1 +quot -2147483648 -4294967296 = 0 +quot -2147483648 4294967294 = 0 +quot -2147483648 4611686018427387904 = 0 +quot -2147483648 4611686014132420609 = 0 +quot 2147483647 1 = 2147483647 +quot 2147483647 -1 = -2147483647 +quot 2147483647 2 = 1073741823 +quot 2147483647 -2 = -1073741823 +quot 2147483647 -2147483648 = 0 +quot 2147483647 2147483647 = 1 +quot 2147483647 -2147483649 = 0 +quot 2147483647 2147483648 = 0 +quot 2147483647 -4294967296 = 0 +quot 2147483647 4294967294 = 0 +quot 2147483647 4611686018427387904 = 0 +quot 2147483647 4611686014132420609 = 0 +rem 0 1 = 0 +rem 0 -1 = 0 +rem 0 2 = 0 +rem 0 -2 = 0 +rem 0 -2147483648 = 0 +rem 0 2147483647 = 0 +rem 0 -2147483649 = 0 +rem 0 2147483648 = 0 +rem 0 -4294967296 = 0 +rem 0 4294967294 = 0 +rem 0 4611686018427387904 = 0 +rem 0 4611686014132420609 = 0 +rem 1 1 = 0 +rem 1 -1 = 0 +rem 1 2 = 1 +rem 1 -2 = 1 +rem 1 -2147483648 = 1 +rem 1 2147483647 = 1 +rem 1 -2147483649 = 1 +rem 1 2147483648 = 1 +rem 1 -4294967296 = 1 +rem 1 4294967294 = 1 +rem 1 4611686018427387904 = 1 +rem 1 4611686014132420609 = 1 +rem -1 1 = 0 +rem -1 -1 = 0 +rem -1 2 = -1 +rem -1 -2 = -1 +rem -1 -2147483648 = -1 +rem -1 2147483647 = -1 +rem -1 -2147483649 = -1 +rem -1 2147483648 = -1 +rem -1 -4294967296 = -1 +rem -1 4294967294 = -1 +rem -1 4611686018427387904 = -1 +rem -1 4611686014132420609 = -1 +rem 2 1 = 0 +rem 2 -1 = 0 +rem 2 2 = 0 +rem 2 -2 = 0 +rem 2 -2147483648 = 2 +rem 2 2147483647 = 2 +rem 2 -2147483649 = 2 +rem 2 2147483648 = 2 +rem 2 -4294967296 = 2 +rem 2 4294967294 = 2 +rem 2 4611686018427387904 = 2 +rem 2 4611686014132420609 = 2 +rem -2 1 = 0 +rem -2 -1 = 0 +rem -2 2 = 0 +rem -2 -2 = 0 +rem -2 -2147483648 = -2 +rem -2 2147483647 = -2 +rem -2 -2147483649 = -2 +rem -2 2147483648 = -2 +rem -2 -4294967296 = -2 +rem -2 4294967294 = -2 +rem -2 4611686018427387904 = -2 +rem -2 4611686014132420609 = -2 +rem -2147483648 1 = 0 +rem -2147483648 -1 = 0 +rem -2147483648 2 = 0 +rem -2147483648 -2 = 0 +rem -2147483648 -2147483648 = 0 +rem -2147483648 2147483647 = -1 +rem -2147483648 -2147483649 = -2147483648 +rem -2147483648 2147483648 = 0 +rem -2147483648 -4294967296 = -2147483648 +rem -2147483648 4294967294 = -2147483648 +rem -2147483648 4611686018427387904 = -2147483648 +rem -2147483648 4611686014132420609 = -2147483648 +rem 2147483647 1 = 0 +rem 2147483647 -1 = 0 +rem 2147483647 2 = 1 +rem 2147483647 -2 = 1 +rem 2147483647 -2147483648 = 2147483647 +rem 2147483647 2147483647 = 0 +rem 2147483647 -2147483649 = 2147483647 +rem 2147483647 2147483648 = 2147483647 +rem 2147483647 -4294967296 = 2147483647 +rem 2147483647 4294967294 = 2147483647 +rem 2147483647 4611686018427387904 = 2147483647 +rem 2147483647 4611686014132420609 = 2147483647 +gcd 0 1 = 1 +gcd 0 -1 = 1 +gcd 0 2 = 2 +gcd 0 -2 = 2 +gcd 0 -2147483648 = 2147483648 +gcd 0 2147483647 = 2147483647 +gcd 1 0 = 1 +gcd 1 1 = 1 +gcd 1 -1 = 1 +gcd 1 2 = 1 +gcd 1 -2 = 1 +gcd 1 -2147483648 = 1 +gcd 1 2147483647 = 1 +gcd -1 0 = 1 +gcd -1 1 = 1 +gcd -1 -1 = 1 +gcd -1 2 = 1 +gcd -1 -2 = 1 +gcd -1 -2147483648 = 1 +gcd -1 2147483647 = 1 +gcd 2 0 = 2 +gcd 2 1 = 1 +gcd 2 -1 = 1 +gcd 2 2 = 2 +gcd 2 -2 = 2 +gcd 2 -2147483648 = 2 +gcd 2 2147483647 = 1 +gcd -2 0 = 2 +gcd -2 1 = 1 +gcd -2 -1 = 1 +gcd -2 2 = 2 +gcd -2 -2 = 2 +gcd -2 -2147483648 = 2 +gcd -2 2147483647 = 1 +gcd -2147483648 0 = 2147483648 +gcd -2147483648 1 = 1 +gcd -2147483648 -1 = 1 +gcd -2147483648 2 = 2 +gcd -2147483648 -2 = 2 +gcd -2147483648 -2147483648 = 2147483648 +gcd -2147483648 2147483647 = 1 +gcd 2147483647 0 = 2147483647 +gcd 2147483647 1 = 1 +gcd 2147483647 -1 = 1 +gcd 2147483647 2 = 1 +gcd 2147483647 -2 = 1 +gcd 2147483647 -2147483648 = 1 +gcd 2147483647 2147483647 = 2147483647 +lcm 0 1 = 0 +lcm 0 -1 = 0 +lcm 0 2 = 0 +lcm 0 -2 = 0 +lcm 0 -2147483648 = 0 +lcm 0 2147483647 = 0 +lcm 1 0 = 0 +lcm 1 1 = 1 +lcm 1 -1 = 1 +lcm 1 2 = 2 +lcm 1 -2 = 2 +lcm 1 -2147483648 = 2147483648 +lcm 1 2147483647 = 2147483647 +lcm -1 0 = 0 +lcm -1 1 = 1 +lcm -1 -1 = 1 +lcm -1 2 = 2 +lcm -1 -2 = 2 +lcm -1 -2147483648 = 2147483648 +lcm -1 2147483647 = 2147483647 +lcm 2 0 = 0 +lcm 2 1 = 2 +lcm 2 -1 = 2 +lcm 2 2 = 2 +lcm 2 -2 = 2 +lcm 2 -2147483648 = 2147483648 +lcm 2 2147483647 = 4294967294 +lcm -2 0 = 0 +lcm -2 1 = 2 +lcm -2 -1 = 2 +lcm -2 2 = 2 +lcm -2 -2 = 2 +lcm -2 -2147483648 = 2147483648 +lcm -2 2147483647 = 4294967294 +lcm -2147483648 0 = 0 +lcm -2147483648 1 = 2147483648 +lcm -2147483648 -1 = 2147483648 +lcm -2147483648 2 = 2147483648 +lcm -2147483648 -2 = 2147483648 +lcm -2147483648 -2147483648 = 2147483648 +lcm -2147483648 2147483647 = 4611686016279904256 +lcm 2147483647 0 = 0 +lcm 2147483647 1 = 2147483647 +lcm 2147483647 -1 = 2147483647 +lcm 2147483647 2 = 4294967294 +lcm 2147483647 -2 = 4294967294 +lcm 2147483647 -2147483648 = 4611686016279904256 +lcm 2147483647 2147483647 = 2147483647 diff --git a/testsuite/tests/numeric/should_run/arith003.stdout-alpha-dec-osf3 b/testsuite/tests/numeric/should_run/arith003.stdout-alpha-dec-osf3 new file mode 100644 index 0000000000..9ea4a0f2eb --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith003.stdout-alpha-dec-osf3 @@ -0,0 +1,1053 @@ +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -9223372036854775808 = -9223372036854775808 +(+) 0 9223372036854775807 = 9223372036854775807 +(+) 1 0 = 1 +(+) 1 1 = 2 +(+) 1 -1 = 0 +(+) 1 2 = 3 +(+) 1 -2 = -1 +(+) 1 -9223372036854775808 = -9223372036854775807 +(+) 1 9223372036854775807 = -9223372036854775808 +(+) -1 0 = -1 +(+) -1 1 = 0 +(+) -1 -1 = -2 +(+) -1 2 = 1 +(+) -1 -2 = -3 +(+) -1 -9223372036854775808 = 9223372036854775807 +(+) -1 9223372036854775807 = 9223372036854775806 +(+) 2 0 = 2 +(+) 2 1 = 3 +(+) 2 -1 = 1 +(+) 2 2 = 4 +(+) 2 -2 = 0 +(+) 2 -9223372036854775808 = -9223372036854775806 +(+) 2 9223372036854775807 = -9223372036854775807 +(+) -2 0 = -2 +(+) -2 1 = -1 +(+) -2 -1 = -3 +(+) -2 2 = 0 +(+) -2 -2 = -4 +(+) -2 -9223372036854775808 = 9223372036854775806 +(+) -2 9223372036854775807 = 9223372036854775805 +(+) -9223372036854775808 0 = -9223372036854775808 +(+) -9223372036854775808 1 = -9223372036854775807 +(+) -9223372036854775808 -1 = 9223372036854775807 +(+) -9223372036854775808 2 = -9223372036854775806 +(+) -9223372036854775808 -2 = 9223372036854775806 +(+) -9223372036854775808 -9223372036854775808 = 0 +(+) -9223372036854775808 9223372036854775807 = -1 +(+) 9223372036854775807 0 = 9223372036854775807 +(+) 9223372036854775807 1 = -9223372036854775808 +(+) 9223372036854775807 -1 = 9223372036854775806 +(+) 9223372036854775807 2 = -9223372036854775807 +(+) 9223372036854775807 -2 = 9223372036854775805 +(+) 9223372036854775807 -9223372036854775808 = -1 +(+) 9223372036854775807 9223372036854775807 = -2 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -9223372036854775808 = -9223372036854775808 +(-) 0 9223372036854775807 = -9223372036854775807 +(-) 1 0 = 1 +(-) 1 1 = 0 +(-) 1 -1 = 2 +(-) 1 2 = -1 +(-) 1 -2 = 3 +(-) 1 -9223372036854775808 = -9223372036854775807 +(-) 1 9223372036854775807 = -9223372036854775806 +(-) -1 0 = -1 +(-) -1 1 = -2 +(-) -1 -1 = 0 +(-) -1 2 = -3 +(-) -1 -2 = 1 +(-) -1 -9223372036854775808 = 9223372036854775807 +(-) -1 9223372036854775807 = -9223372036854775808 +(-) 2 0 = 2 +(-) 2 1 = 1 +(-) 2 -1 = 3 +(-) 2 2 = 0 +(-) 2 -2 = 4 +(-) 2 -9223372036854775808 = -9223372036854775806 +(-) 2 9223372036854775807 = -9223372036854775805 +(-) -2 0 = -2 +(-) -2 1 = -3 +(-) -2 -1 = -1 +(-) -2 2 = -4 +(-) -2 -2 = 0 +(-) -2 -9223372036854775808 = 9223372036854775806 +(-) -2 9223372036854775807 = 9223372036854775807 +(-) -9223372036854775808 0 = -9223372036854775808 +(-) -9223372036854775808 1 = 9223372036854775807 +(-) -9223372036854775808 -1 = -9223372036854775807 +(-) -9223372036854775808 2 = 9223372036854775806 +(-) -9223372036854775808 -2 = -9223372036854775806 +(-) -9223372036854775808 -9223372036854775808 = 0 +(-) -9223372036854775808 9223372036854775807 = 1 +(-) 9223372036854775807 0 = 9223372036854775807 +(-) 9223372036854775807 1 = 9223372036854775806 +(-) 9223372036854775807 -1 = -9223372036854775808 +(-) 9223372036854775807 2 = 9223372036854775805 +(-) 9223372036854775807 -2 = -9223372036854775807 +(-) 9223372036854775807 -9223372036854775808 = -1 +(-) 9223372036854775807 9223372036854775807 = 0 +(^) 0 0 = 1 +(^) 0 1 = 0 +(^) 0 2 = 0 +(^) 1 0 = 1 +(^) 1 1 = 1 +(^) 1 2 = 1 +(^) -1 0 = 1 +(^) -1 1 = -1 +(^) -1 2 = 1 +(^) 2 0 = 1 +(^) 2 1 = 2 +(^) 2 2 = 4 +(^) -2 0 = 1 +(^) -2 1 = -2 +(^) -2 2 = 4 +(^) -9223372036854775808 0 = 1 +(^) -9223372036854775808 1 = -9223372036854775808 +(^) -9223372036854775808 2 = 0 +(^) 9223372036854775807 0 = 1 +(^) 9223372036854775807 1 = 9223372036854775807 +(^) 9223372036854775807 2 = 1 +div 0 1 = 0 +div 0 -1 = 0 +div 0 2 = 0 +div 0 -2 = 0 +div 0 -9223372036854775808 = 0 +div 0 9223372036854775807 = 0 +div 1 1 = 1 +div 1 -1 = -1 +div 1 2 = 0 +div 1 -2 = -1 +div 1 -9223372036854775808 = -1 +div 1 9223372036854775807 = 0 +div -1 1 = -1 +div -1 -1 = 1 +div -1 2 = -1 +div -1 -2 = 0 +div -1 -9223372036854775808 = 0 +div -1 9223372036854775807 = -1 +div 2 1 = 2 +div 2 -1 = -2 +div 2 2 = 1 +div 2 -2 = -1 +div 2 -9223372036854775808 = -1 +div 2 9223372036854775807 = 0 +div -2 1 = -2 +div -2 -1 = 2 +div -2 2 = -1 +div -2 -2 = 1 +div -2 -9223372036854775808 = 0 +div -2 9223372036854775807 = -1 +div 9223372036854775807 1 = 9223372036854775807 +div 9223372036854775807 -1 = -9223372036854775807 +div 9223372036854775807 2 = 4611686018427387903 +div 9223372036854775807 -2 = -4611686018427387904 +div 9223372036854775807 -9223372036854775808 = -1 +div 9223372036854775807 9223372036854775807 = 1 +mod 0 1 = 0 +mod 0 -1 = 0 +mod 0 2 = 0 +mod 0 -2 = 0 +mod 0 -9223372036854775808 = 0 +mod 0 9223372036854775807 = 0 +mod 1 1 = 0 +mod 1 -1 = 0 +mod 1 2 = 1 +mod 1 -2 = -1 +mod 1 -9223372036854775808 = -9223372036854775807 +mod 1 9223372036854775807 = 1 +mod -1 1 = 0 +mod -1 -1 = 0 +mod -1 2 = 1 +mod -1 -2 = -1 +mod -1 -9223372036854775808 = -1 +mod -1 9223372036854775807 = 9223372036854775806 +mod 2 1 = 0 +mod 2 -1 = 0 +mod 2 2 = 0 +mod 2 -2 = 0 +mod 2 -9223372036854775808 = -9223372036854775806 +mod 2 9223372036854775807 = 2 +mod -2 1 = 0 +mod -2 -1 = 0 +mod -2 2 = 0 +mod -2 -2 = 0 +mod -2 -9223372036854775808 = -2 +mod -2 9223372036854775807 = 9223372036854775805 +mod 9223372036854775807 1 = 0 +mod 9223372036854775807 -1 = 0 +mod 9223372036854775807 2 = 1 +mod 9223372036854775807 -2 = -1 +mod 9223372036854775807 -9223372036854775808 = -1 +mod 9223372036854775807 9223372036854775807 = 0 +quot 0 1 = 0 +quot 0 -1 = 0 +quot 0 2 = 0 +quot 0 -2 = 0 +quot 0 -9223372036854775808 = 0 +quot 0 9223372036854775807 = 0 +quot 1 1 = 1 +quot 1 -1 = -1 +quot 1 2 = 0 +quot 1 -2 = 0 +quot 1 -9223372036854775808 = 0 +quot 1 9223372036854775807 = 0 +quot -1 1 = -1 +quot -1 -1 = 1 +quot -1 2 = 0 +quot -1 -2 = 0 +quot -1 -9223372036854775808 = 0 +quot -1 9223372036854775807 = 0 +quot 2 1 = 2 +quot 2 -1 = -2 +quot 2 2 = 1 +quot 2 -2 = -1 +quot 2 -9223372036854775808 = 0 +quot 2 9223372036854775807 = 0 +quot -2 1 = -2 +quot -2 -1 = 2 +quot -2 2 = -1 +quot -2 -2 = 1 +quot -2 -9223372036854775808 = 0 +quot -2 9223372036854775807 = 0 +quot 9223372036854775807 1 = 9223372036854775807 +quot 9223372036854775807 -1 = -9223372036854775807 +quot 9223372036854775807 2 = 4611686018427387903 +quot 9223372036854775807 -2 = -4611686018427387903 +quot 9223372036854775807 -9223372036854775808 = 0 +quot 9223372036854775807 9223372036854775807 = 1 +rem 0 1 = 0 +rem 0 -1 = 0 +rem 0 2 = 0 +rem 0 -2 = 0 +rem 0 -9223372036854775808 = 0 +rem 0 9223372036854775807 = 0 +rem 1 1 = 0 +rem 1 -1 = 0 +rem 1 2 = 1 +rem 1 -2 = 1 +rem 1 -9223372036854775808 = 1 +rem 1 9223372036854775807 = 1 +rem -1 1 = 0 +rem -1 -1 = 0 +rem -1 2 = -1 +rem -1 -2 = -1 +rem -1 -9223372036854775808 = -1 +rem -1 9223372036854775807 = -1 +rem 2 1 = 0 +rem 2 -1 = 0 +rem 2 2 = 0 +rem 2 -2 = 0 +rem 2 -9223372036854775808 = 2 +rem 2 9223372036854775807 = 2 +rem -2 1 = 0 +rem -2 -1 = 0 +rem -2 2 = 0 +rem -2 -2 = 0 +rem -2 -9223372036854775808 = -2 +rem -2 9223372036854775807 = -2 +rem 9223372036854775807 1 = 0 +rem 9223372036854775807 -1 = 0 +rem 9223372036854775807 2 = 1 +rem 9223372036854775807 -2 = 1 +rem 9223372036854775807 -9223372036854775808 = 9223372036854775807 +rem 9223372036854775807 9223372036854775807 = 0 +gcd 0 1 = 1 +gcd 0 -1 = 1 +gcd 0 2 = 2 +gcd 0 -2 = 2 +gcd 0 9223372036854775807 = 9223372036854775807 +gcd 1 0 = 1 +gcd 1 1 = 1 +gcd 1 -1 = 1 +gcd 1 2 = 1 +gcd 1 -2 = 1 +gcd 1 9223372036854775807 = 1 +gcd -1 0 = 1 +gcd -1 1 = 1 +gcd -1 -1 = 1 +gcd -1 2 = 1 +gcd -1 -2 = 1 +gcd -1 9223372036854775807 = 1 +gcd 2 0 = 2 +gcd 2 1 = 1 +gcd 2 -1 = 1 +gcd 2 2 = 2 +gcd 2 -2 = 2 +gcd 2 9223372036854775807 = 1 +gcd -2 0 = 2 +gcd -2 1 = 1 +gcd -2 -1 = 1 +gcd -2 2 = 2 +gcd -2 -2 = 2 +gcd -2 9223372036854775807 = 1 +gcd 9223372036854775807 0 = 9223372036854775807 +gcd 9223372036854775807 1 = 1 +gcd 9223372036854775807 -1 = 1 +gcd 9223372036854775807 2 = 1 +gcd 9223372036854775807 -2 = 1 +gcd 9223372036854775807 9223372036854775807 = 9223372036854775807 +lcm 0 1 = 0 +lcm 0 -1 = 0 +lcm 0 2 = 0 +lcm 0 -2 = 0 +lcm 0 -9223372036854775808 = 0 +lcm 1 0 = 0 +lcm 1 1 = 1 +lcm 1 -1 = 1 +lcm 1 2 = 2 +lcm 1 -2 = 2 +lcm 1 -9223372036854775808 = -9223372036854775808 +lcm -1 0 = 0 +lcm -1 1 = 1 +lcm -1 -1 = 1 +lcm -1 2 = 2 +lcm -1 -2 = 2 +lcm -1 -9223372036854775808 = -9223372036854775808 +lcm 2 0 = 0 +lcm 2 1 = 2 +lcm 2 -1 = 2 +lcm 2 2 = 2 +lcm 2 -2 = 2 +lcm 2 -9223372036854775808 = -9223372036854775808 +lcm -2 0 = 0 +lcm -2 1 = 2 +lcm -2 -1 = 2 +lcm -2 2 = 2 +lcm -2 -2 = 2 +lcm -2 -9223372036854775808 = -9223372036854775808 +lcm -9223372036854775808 0 = 0 +lcm -9223372036854775808 1 = -9223372036854775808 +lcm -9223372036854775808 -1 = -9223372036854775808 +lcm -9223372036854775808 2 = -9223372036854775808 +lcm -9223372036854775808 -2 = -9223372036854775808 +lcm -9223372036854775808 -9223372036854775808 = -9223372036854775808 +lcm 9223372036854775807 0 = 0 +lcm 9223372036854775807 1 = 9223372036854775807 +lcm 9223372036854775807 -1 = 9223372036854775807 +lcm 9223372036854775807 2 = 2 +lcm 9223372036854775807 -2 = 2 +lcm 9223372036854775807 -9223372036854775808 = -9223372036854775808 +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -9223372036854775808 = -9223372036854775808 +(+) 0 9223372036854775807 = 9223372036854775807 +(+) 0 -9223372036854775809 = -9223372036854775809 +(+) 0 9223372036854775808 = 9223372036854775808 +(+) 0 0 = 0 +(+) 0 18446744073709551614 = 18446744073709551614 +(+) 0 0 = 0 +(+) 0 85070591730234615847396907784232501249 = 85070591730234615847396907784232501249 +(+) 1 0 = 1 +(+) 1 1 = 2 +(+) 1 -1 = 0 +(+) 1 2 = 3 +(+) 1 -2 = -1 +(+) 1 -9223372036854775808 = -9223372036854775807 +(+) 1 9223372036854775807 = 9223372036854775808 +(+) 1 -9223372036854775809 = -9223372036854775808 +(+) 1 9223372036854775808 = 9223372036854775809 +(+) 1 0 = 1 +(+) 1 18446744073709551614 = 18446744073709551615 +(+) 1 0 = 1 +(+) 1 85070591730234615847396907784232501249 = 85070591730234615847396907784232501250 +(+) -1 0 = -1 +(+) -1 1 = 0 +(+) -1 -1 = -2 +(+) -1 2 = 1 +(+) -1 -2 = -3 +(+) -1 -9223372036854775808 = -9223372036854775809 +(+) -1 9223372036854775807 = 9223372036854775806 +(+) -1 -9223372036854775809 = -9223372036854775810 +(+) -1 9223372036854775808 = 9223372036854775807 +(+) -1 0 = -1 +(+) -1 18446744073709551614 = 18446744073709551613 +(+) -1 0 = -1 +(+) -1 85070591730234615847396907784232501249 = 85070591730234615847396907784232501248 +(+) 2 0 = 2 +(+) 2 1 = 3 +(+) 2 -1 = 1 +(+) 2 2 = 4 +(+) 2 -2 = 0 +(+) 2 -9223372036854775808 = -9223372036854775806 +(+) 2 9223372036854775807 = 9223372036854775809 +(+) 2 -9223372036854775809 = -9223372036854775807 +(+) 2 9223372036854775808 = 9223372036854775810 +(+) 2 0 = 2 +(+) 2 18446744073709551614 = 18446744073709551616 +(+) 2 0 = 2 +(+) 2 85070591730234615847396907784232501249 = 85070591730234615847396907784232501251 +(+) -2 0 = -2 +(+) -2 1 = -1 +(+) -2 -1 = -3 +(+) -2 2 = 0 +(+) -2 -2 = -4 +(+) -2 -9223372036854775808 = -9223372036854775810 +(+) -2 9223372036854775807 = 9223372036854775805 +(+) -2 -9223372036854775809 = -9223372036854775811 +(+) -2 9223372036854775808 = 9223372036854775806 +(+) -2 0 = -2 +(+) -2 18446744073709551614 = 18446744073709551612 +(+) -2 0 = -2 +(+) -2 85070591730234615847396907784232501249 = 85070591730234615847396907784232501247 +(+) -9223372036854775808 0 = -9223372036854775808 +(+) -9223372036854775808 1 = -9223372036854775807 +(+) -9223372036854775808 -1 = -9223372036854775809 +(+) -9223372036854775808 2 = -9223372036854775806 +(+) -9223372036854775808 -2 = -9223372036854775810 +(+) -9223372036854775808 -9223372036854775808 = -18446744073709551616 +(+) -9223372036854775808 9223372036854775807 = -1 +(+) -9223372036854775808 -9223372036854775809 = -18446744073709551617 +(+) -9223372036854775808 9223372036854775808 = 0 +(+) -9223372036854775808 0 = -9223372036854775808 +(+) -9223372036854775808 18446744073709551614 = 9223372036854775806 +(+) -9223372036854775808 0 = -9223372036854775808 +(+) -9223372036854775808 85070591730234615847396907784232501249 = 85070591730234615838173535747377725441 +(+) 9223372036854775807 0 = 9223372036854775807 +(+) 9223372036854775807 1 = 9223372036854775808 +(+) 9223372036854775807 -1 = 9223372036854775806 +(+) 9223372036854775807 2 = 9223372036854775809 +(+) 9223372036854775807 -2 = 9223372036854775805 +(+) 9223372036854775807 -9223372036854775808 = -1 +(+) 9223372036854775807 9223372036854775807 = 18446744073709551614 +(+) 9223372036854775807 -9223372036854775809 = -2 +(+) 9223372036854775807 9223372036854775808 = 18446744073709551615 +(+) 9223372036854775807 0 = 9223372036854775807 +(+) 9223372036854775807 18446744073709551614 = 27670116110564327421 +(+) 9223372036854775807 0 = 9223372036854775807 +(+) 9223372036854775807 85070591730234615847396907784232501249 = 85070591730234615856620279821087277056 +(+) -9223372036854775809 0 = -9223372036854775809 +(+) -9223372036854775809 1 = -9223372036854775808 +(+) -9223372036854775809 -1 = -9223372036854775810 +(+) -9223372036854775809 2 = -9223372036854775807 +(+) -9223372036854775809 -2 = -9223372036854775811 +(+) -9223372036854775809 -9223372036854775808 = -18446744073709551617 +(+) -9223372036854775809 9223372036854775807 = -2 +(+) -9223372036854775809 -9223372036854775809 = -18446744073709551618 +(+) -9223372036854775809 9223372036854775808 = -1 +(+) -9223372036854775809 0 = -9223372036854775809 +(+) -9223372036854775809 18446744073709551614 = 9223372036854775805 +(+) -9223372036854775809 0 = -9223372036854775809 +(+) -9223372036854775809 85070591730234615847396907784232501249 = 85070591730234615838173535747377725440 +(+) 9223372036854775808 0 = 9223372036854775808 +(+) 9223372036854775808 1 = 9223372036854775809 +(+) 9223372036854775808 -1 = 9223372036854775807 +(+) 9223372036854775808 2 = 9223372036854775810 +(+) 9223372036854775808 -2 = 9223372036854775806 +(+) 9223372036854775808 -9223372036854775808 = 0 +(+) 9223372036854775808 9223372036854775807 = 18446744073709551615 +(+) 9223372036854775808 -9223372036854775809 = -1 +(+) 9223372036854775808 9223372036854775808 = 18446744073709551616 +(+) 9223372036854775808 0 = 9223372036854775808 +(+) 9223372036854775808 18446744073709551614 = 27670116110564327422 +(+) 9223372036854775808 0 = 9223372036854775808 +(+) 9223372036854775808 85070591730234615847396907784232501249 = 85070591730234615856620279821087277057 +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -9223372036854775808 = -9223372036854775808 +(+) 0 9223372036854775807 = 9223372036854775807 +(+) 0 -9223372036854775809 = -9223372036854775809 +(+) 0 9223372036854775808 = 9223372036854775808 +(+) 0 0 = 0 +(+) 0 18446744073709551614 = 18446744073709551614 +(+) 0 0 = 0 +(+) 0 85070591730234615847396907784232501249 = 85070591730234615847396907784232501249 +(+) 18446744073709551614 0 = 18446744073709551614 +(+) 18446744073709551614 1 = 18446744073709551615 +(+) 18446744073709551614 -1 = 18446744073709551613 +(+) 18446744073709551614 2 = 18446744073709551616 +(+) 18446744073709551614 -2 = 18446744073709551612 +(+) 18446744073709551614 -9223372036854775808 = 9223372036854775806 +(+) 18446744073709551614 9223372036854775807 = 27670116110564327421 +(+) 18446744073709551614 -9223372036854775809 = 9223372036854775805 +(+) 18446744073709551614 9223372036854775808 = 27670116110564327422 +(+) 18446744073709551614 0 = 18446744073709551614 +(+) 18446744073709551614 18446744073709551614 = 36893488147419103228 +(+) 18446744073709551614 0 = 18446744073709551614 +(+) 18446744073709551614 85070591730234615847396907784232501249 = 85070591730234615865843651857942052863 +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -9223372036854775808 = -9223372036854775808 +(+) 0 9223372036854775807 = 9223372036854775807 +(+) 0 -9223372036854775809 = -9223372036854775809 +(+) 0 9223372036854775808 = 9223372036854775808 +(+) 0 0 = 0 +(+) 0 18446744073709551614 = 18446744073709551614 +(+) 0 0 = 0 +(+) 0 85070591730234615847396907784232501249 = 85070591730234615847396907784232501249 +(+) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(+) 85070591730234615847396907784232501249 1 = 85070591730234615847396907784232501250 +(+) 85070591730234615847396907784232501249 -1 = 85070591730234615847396907784232501248 +(+) 85070591730234615847396907784232501249 2 = 85070591730234615847396907784232501251 +(+) 85070591730234615847396907784232501249 -2 = 85070591730234615847396907784232501247 +(+) 85070591730234615847396907784232501249 -9223372036854775808 = 85070591730234615838173535747377725441 +(+) 85070591730234615847396907784232501249 9223372036854775807 = 85070591730234615856620279821087277056 +(+) 85070591730234615847396907784232501249 -9223372036854775809 = 85070591730234615838173535747377725440 +(+) 85070591730234615847396907784232501249 9223372036854775808 = 85070591730234615856620279821087277057 +(+) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(+) 85070591730234615847396907784232501249 18446744073709551614 = 85070591730234615865843651857942052863 +(+) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(+) 85070591730234615847396907784232501249 85070591730234615847396907784232501249 = 170141183460469231694793815568465002498 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -9223372036854775808 = 9223372036854775808 +(-) 0 9223372036854775807 = -9223372036854775807 +(-) 0 -9223372036854775809 = 9223372036854775809 +(-) 0 9223372036854775808 = -9223372036854775808 +(-) 0 0 = 0 +(-) 0 18446744073709551614 = -18446744073709551614 +(-) 0 0 = 0 +(-) 0 85070591730234615847396907784232501249 = -85070591730234615847396907784232501249 +(-) 1 0 = 1 +(-) 1 1 = 0 +(-) 1 -1 = 2 +(-) 1 2 = -1 +(-) 1 -2 = 3 +(-) 1 -9223372036854775808 = 9223372036854775809 +(-) 1 9223372036854775807 = -9223372036854775806 +(-) 1 -9223372036854775809 = 9223372036854775810 +(-) 1 9223372036854775808 = -9223372036854775807 +(-) 1 0 = 1 +(-) 1 18446744073709551614 = -18446744073709551613 +(-) 1 0 = 1 +(-) 1 85070591730234615847396907784232501249 = -85070591730234615847396907784232501248 +(-) -1 0 = -1 +(-) -1 1 = -2 +(-) -1 -1 = 0 +(-) -1 2 = -3 +(-) -1 -2 = 1 +(-) -1 -9223372036854775808 = 9223372036854775807 +(-) -1 9223372036854775807 = -9223372036854775808 +(-) -1 -9223372036854775809 = 9223372036854775808 +(-) -1 9223372036854775808 = -9223372036854775809 +(-) -1 0 = -1 +(-) -1 18446744073709551614 = -18446744073709551615 +(-) -1 0 = -1 +(-) -1 85070591730234615847396907784232501249 = -85070591730234615847396907784232501250 +(-) 2 0 = 2 +(-) 2 1 = 1 +(-) 2 -1 = 3 +(-) 2 2 = 0 +(-) 2 -2 = 4 +(-) 2 -9223372036854775808 = 9223372036854775810 +(-) 2 9223372036854775807 = -9223372036854775805 +(-) 2 -9223372036854775809 = 9223372036854775811 +(-) 2 9223372036854775808 = -9223372036854775806 +(-) 2 0 = 2 +(-) 2 18446744073709551614 = -18446744073709551612 +(-) 2 0 = 2 +(-) 2 85070591730234615847396907784232501249 = -85070591730234615847396907784232501247 +(-) -2 0 = -2 +(-) -2 1 = -3 +(-) -2 -1 = -1 +(-) -2 2 = -4 +(-) -2 -2 = 0 +(-) -2 -9223372036854775808 = 9223372036854775806 +(-) -2 9223372036854775807 = -9223372036854775809 +(-) -2 -9223372036854775809 = 9223372036854775807 +(-) -2 9223372036854775808 = -9223372036854775810 +(-) -2 0 = -2 +(-) -2 18446744073709551614 = -18446744073709551616 +(-) -2 0 = -2 +(-) -2 85070591730234615847396907784232501249 = -85070591730234615847396907784232501251 +(-) -9223372036854775808 0 = -9223372036854775808 +(-) -9223372036854775808 1 = -9223372036854775809 +(-) -9223372036854775808 -1 = -9223372036854775807 +(-) -9223372036854775808 2 = -9223372036854775810 +(-) -9223372036854775808 -2 = -9223372036854775806 +(-) -9223372036854775808 -9223372036854775808 = 0 +(-) -9223372036854775808 9223372036854775807 = -18446744073709551615 +(-) -9223372036854775808 -9223372036854775809 = 1 +(-) -9223372036854775808 9223372036854775808 = -18446744073709551616 +(-) -9223372036854775808 0 = -9223372036854775808 +(-) -9223372036854775808 18446744073709551614 = -27670116110564327422 +(-) -9223372036854775808 0 = -9223372036854775808 +(-) -9223372036854775808 85070591730234615847396907784232501249 = -85070591730234615856620279821087277057 +(-) 9223372036854775807 0 = 9223372036854775807 +(-) 9223372036854775807 1 = 9223372036854775806 +(-) 9223372036854775807 -1 = 9223372036854775808 +(-) 9223372036854775807 2 = 9223372036854775805 +(-) 9223372036854775807 -2 = 9223372036854775809 +(-) 9223372036854775807 -9223372036854775808 = 18446744073709551615 +(-) 9223372036854775807 9223372036854775807 = 0 +(-) 9223372036854775807 -9223372036854775809 = 18446744073709551616 +(-) 9223372036854775807 9223372036854775808 = -1 +(-) 9223372036854775807 0 = 9223372036854775807 +(-) 9223372036854775807 18446744073709551614 = -9223372036854775807 +(-) 9223372036854775807 0 = 9223372036854775807 +(-) 9223372036854775807 85070591730234615847396907784232501249 = -85070591730234615838173535747377725442 +(-) -9223372036854775809 0 = -9223372036854775809 +(-) -9223372036854775809 1 = -9223372036854775810 +(-) -9223372036854775809 -1 = -9223372036854775808 +(-) -9223372036854775809 2 = -9223372036854775811 +(-) -9223372036854775809 -2 = -9223372036854775807 +(-) -9223372036854775809 -9223372036854775808 = -1 +(-) -9223372036854775809 9223372036854775807 = -18446744073709551616 +(-) -9223372036854775809 -9223372036854775809 = 0 +(-) -9223372036854775809 9223372036854775808 = -18446744073709551617 +(-) -9223372036854775809 0 = -9223372036854775809 +(-) -9223372036854775809 18446744073709551614 = -27670116110564327423 +(-) -9223372036854775809 0 = -9223372036854775809 +(-) -9223372036854775809 85070591730234615847396907784232501249 = -85070591730234615856620279821087277058 +(-) 9223372036854775808 0 = 9223372036854775808 +(-) 9223372036854775808 1 = 9223372036854775807 +(-) 9223372036854775808 -1 = 9223372036854775809 +(-) 9223372036854775808 2 = 9223372036854775806 +(-) 9223372036854775808 -2 = 9223372036854775810 +(-) 9223372036854775808 -9223372036854775808 = 18446744073709551616 +(-) 9223372036854775808 9223372036854775807 = 1 +(-) 9223372036854775808 -9223372036854775809 = 18446744073709551617 +(-) 9223372036854775808 9223372036854775808 = 0 +(-) 9223372036854775808 0 = 9223372036854775808 +(-) 9223372036854775808 18446744073709551614 = -9223372036854775806 +(-) 9223372036854775808 0 = 9223372036854775808 +(-) 9223372036854775808 85070591730234615847396907784232501249 = -85070591730234615838173535747377725441 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -9223372036854775808 = 9223372036854775808 +(-) 0 9223372036854775807 = -9223372036854775807 +(-) 0 -9223372036854775809 = 9223372036854775809 +(-) 0 9223372036854775808 = -9223372036854775808 +(-) 0 0 = 0 +(-) 0 18446744073709551614 = -18446744073709551614 +(-) 0 0 = 0 +(-) 0 85070591730234615847396907784232501249 = -85070591730234615847396907784232501249 +(-) 18446744073709551614 0 = 18446744073709551614 +(-) 18446744073709551614 1 = 18446744073709551613 +(-) 18446744073709551614 -1 = 18446744073709551615 +(-) 18446744073709551614 2 = 18446744073709551612 +(-) 18446744073709551614 -2 = 18446744073709551616 +(-) 18446744073709551614 -9223372036854775808 = 27670116110564327422 +(-) 18446744073709551614 9223372036854775807 = 9223372036854775807 +(-) 18446744073709551614 -9223372036854775809 = 27670116110564327423 +(-) 18446744073709551614 9223372036854775808 = 9223372036854775806 +(-) 18446744073709551614 0 = 18446744073709551614 +(-) 18446744073709551614 18446744073709551614 = 0 +(-) 18446744073709551614 0 = 18446744073709551614 +(-) 18446744073709551614 85070591730234615847396907784232501249 = -85070591730234615828950163710522949635 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -9223372036854775808 = 9223372036854775808 +(-) 0 9223372036854775807 = -9223372036854775807 +(-) 0 -9223372036854775809 = 9223372036854775809 +(-) 0 9223372036854775808 = -9223372036854775808 +(-) 0 0 = 0 +(-) 0 18446744073709551614 = -18446744073709551614 +(-) 0 0 = 0 +(-) 0 85070591730234615847396907784232501249 = -85070591730234615847396907784232501249 +(-) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(-) 85070591730234615847396907784232501249 1 = 85070591730234615847396907784232501248 +(-) 85070591730234615847396907784232501249 -1 = 85070591730234615847396907784232501250 +(-) 85070591730234615847396907784232501249 2 = 85070591730234615847396907784232501247 +(-) 85070591730234615847396907784232501249 -2 = 85070591730234615847396907784232501251 +(-) 85070591730234615847396907784232501249 -9223372036854775808 = 85070591730234615856620279821087277057 +(-) 85070591730234615847396907784232501249 9223372036854775807 = 85070591730234615838173535747377725442 +(-) 85070591730234615847396907784232501249 -9223372036854775809 = 85070591730234615856620279821087277058 +(-) 85070591730234615847396907784232501249 9223372036854775808 = 85070591730234615838173535747377725441 +(-) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(-) 85070591730234615847396907784232501249 18446744073709551614 = 85070591730234615828950163710522949635 +(-) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(-) 85070591730234615847396907784232501249 85070591730234615847396907784232501249 = 0 +div 0 1 = 0 +div 0 -1 = 0 +div 0 2 = 0 +div 0 -2 = 0 +div 0 -9223372036854775808 = 0 +div 0 9223372036854775807 = 0 +div 0 -9223372036854775809 = 0 +div 0 9223372036854775808 = 0 +div 0 18446744073709551614 = 0 +div 0 85070591730234615847396907784232501249 = 0 +div 1 1 = 1 +div 1 -1 = -1 +div 1 2 = 0 +div 1 -2 = -1 +div 1 -9223372036854775808 = -1 +div 1 9223372036854775807 = 0 +div 1 -9223372036854775809 = -1 +div 1 9223372036854775808 = 0 +div 1 18446744073709551614 = 0 +div 1 85070591730234615847396907784232501249 = 0 +div -1 1 = -1 +div -1 -1 = 1 +div -1 2 = -1 +div -1 -2 = 0 +div -1 -9223372036854775808 = 0 +div -1 9223372036854775807 = -1 +div -1 -9223372036854775809 = 0 +div -1 9223372036854775808 = -1 +div -1 18446744073709551614 = -1 +div -1 85070591730234615847396907784232501249 = -1 +div 2 1 = 2 +div 2 -1 = -2 +div 2 2 = 1 +div 2 -2 = -1 +div 2 -9223372036854775808 = -1 +div 2 9223372036854775807 = 0 +div 2 -9223372036854775809 = -1 +div 2 9223372036854775808 = 0 +div 2 18446744073709551614 = 0 +div 2 85070591730234615847396907784232501249 = 0 +div -2 1 = -2 +div -2 -1 = 2 +div -2 2 = -1 +div -2 -2 = 1 +div -2 -9223372036854775808 = 0 +div -2 9223372036854775807 = -1 +div -2 -9223372036854775809 = 0 +div -2 9223372036854775808 = -1 +div -2 18446744073709551614 = -1 +div -2 85070591730234615847396907784232501249 = -1 +div -9223372036854775808 1 = -9223372036854775808 +div -9223372036854775808 -1 = 9223372036854775808 +div -9223372036854775808 2 = -4611686018427387904 +div -9223372036854775808 -2 = 4611686018427387904 +div -9223372036854775808 -9223372036854775808 = 1 +div -9223372036854775808 9223372036854775807 = -2 +div -9223372036854775808 -9223372036854775809 = 0 +div -9223372036854775808 9223372036854775808 = -1 +div -9223372036854775808 18446744073709551614 = -1 +div -9223372036854775808 85070591730234615847396907784232501249 = -1 +div 9223372036854775807 1 = 9223372036854775807 +div 9223372036854775807 -1 = -9223372036854775807 +div 9223372036854775807 2 = 4611686018427387903 +div 9223372036854775807 -2 = -4611686018427387904 +div 9223372036854775807 -9223372036854775808 = -1 +div 9223372036854775807 9223372036854775807 = 1 +div 9223372036854775807 -9223372036854775809 = -1 +div 9223372036854775807 9223372036854775808 = 0 +div 9223372036854775807 18446744073709551614 = 0 +div 9223372036854775807 85070591730234615847396907784232501249 = 0 +mod 0 1 = 0 +mod 0 -1 = 0 +mod 0 2 = 0 +mod 0 -2 = 0 +mod 0 -9223372036854775808 = 0 +mod 0 9223372036854775807 = 0 +mod 0 -9223372036854775809 = 0 +mod 0 9223372036854775808 = 0 +mod 0 18446744073709551614 = 0 +mod 0 85070591730234615847396907784232501249 = 0 +mod 1 1 = 0 +mod 1 -1 = 0 +mod 1 2 = 1 +mod 1 -2 = -1 +mod 1 -9223372036854775808 = -9223372036854775807 +mod 1 9223372036854775807 = 1 +mod 1 -9223372036854775809 = -9223372036854775808 +mod 1 9223372036854775808 = 1 +mod 1 18446744073709551614 = 1 +mod 1 85070591730234615847396907784232501249 = 1 +mod -1 1 = 0 +mod -1 -1 = 0 +mod -1 2 = 1 +mod -1 -2 = -1 +mod -1 -9223372036854775808 = -1 +mod -1 9223372036854775807 = 9223372036854775806 +mod -1 -9223372036854775809 = -1 +mod -1 9223372036854775808 = 9223372036854775807 +mod -1 18446744073709551614 = 18446744073709551613 +mod -1 85070591730234615847396907784232501249 = 85070591730234615847396907784232501248 +mod 2 1 = 0 +mod 2 -1 = 0 +mod 2 2 = 0 +mod 2 -2 = 0 +mod 2 -9223372036854775808 = -9223372036854775806 +mod 2 9223372036854775807 = 2 +mod 2 -9223372036854775809 = -9223372036854775807 +mod 2 9223372036854775808 = 2 +mod 2 18446744073709551614 = 2 +mod 2 85070591730234615847396907784232501249 = 2 +mod -2 1 = 0 +mod -2 -1 = 0 +mod -2 2 = 0 +mod -2 -2 = 0 +mod -2 -9223372036854775808 = -2 +mod -2 9223372036854775807 = 9223372036854775805 +mod -2 -9223372036854775809 = -2 +mod -2 9223372036854775808 = 9223372036854775806 +mod -2 18446744073709551614 = 18446744073709551612 +mod -2 85070591730234615847396907784232501249 = 85070591730234615847396907784232501247 +mod -9223372036854775808 1 = 0 +mod -9223372036854775808 -1 = 0 +mod -9223372036854775808 2 = 0 +mod -9223372036854775808 -2 = 0 +mod -9223372036854775808 -9223372036854775808 = 0 +mod -9223372036854775808 9223372036854775807 = 9223372036854775806 +mod -9223372036854775808 -9223372036854775809 = -9223372036854775808 +mod -9223372036854775808 9223372036854775808 = 0 +mod -9223372036854775808 18446744073709551614 = 9223372036854775806 +mod -9223372036854775808 85070591730234615847396907784232501249 = 85070591730234615838173535747377725441 +mod 9223372036854775807 1 = 0 +mod 9223372036854775807 -1 = 0 +mod 9223372036854775807 2 = 1 +mod 9223372036854775807 -2 = -1 +mod 9223372036854775807 -9223372036854775808 = -1 +mod 9223372036854775807 9223372036854775807 = 0 +mod 9223372036854775807 -9223372036854775809 = -2 +mod 9223372036854775807 9223372036854775808 = 9223372036854775807 +mod 9223372036854775807 18446744073709551614 = 9223372036854775807 +mod 9223372036854775807 85070591730234615847396907784232501249 = 9223372036854775807 +quot 0 1 = 0 +quot 0 -1 = 0 +quot 0 2 = 0 +quot 0 -2 = 0 +quot 0 -9223372036854775808 = 0 +quot 0 9223372036854775807 = 0 +quot 0 -9223372036854775809 = 0 +quot 0 9223372036854775808 = 0 +quot 0 18446744073709551614 = 0 +quot 0 85070591730234615847396907784232501249 = 0 +quot 1 1 = 1 +quot 1 -1 = -1 +quot 1 2 = 0 +quot 1 -2 = 0 +quot 1 -9223372036854775808 = 0 +quot 1 9223372036854775807 = 0 +quot 1 -9223372036854775809 = 0 +quot 1 9223372036854775808 = 0 +quot 1 18446744073709551614 = 0 +quot 1 85070591730234615847396907784232501249 = 0 +quot -1 1 = -1 +quot -1 -1 = 1 +quot -1 2 = 0 +quot -1 -2 = 0 +quot -1 -9223372036854775808 = 0 +quot -1 9223372036854775807 = 0 +quot -1 -9223372036854775809 = 0 +quot -1 9223372036854775808 = 0 +quot -1 18446744073709551614 = 0 +quot -1 85070591730234615847396907784232501249 = 0 +quot 2 1 = 2 +quot 2 -1 = -2 +quot 2 2 = 1 +quot 2 -2 = -1 +quot 2 -9223372036854775808 = 0 +quot 2 9223372036854775807 = 0 +quot 2 -9223372036854775809 = 0 +quot 2 9223372036854775808 = 0 +quot 2 18446744073709551614 = 0 +quot 2 85070591730234615847396907784232501249 = 0 +quot -2 1 = -2 +quot -2 -1 = 2 +quot -2 2 = -1 +quot -2 -2 = 1 +quot -2 -9223372036854775808 = 0 +quot -2 9223372036854775807 = 0 +quot -2 -9223372036854775809 = 0 +quot -2 9223372036854775808 = 0 +quot -2 18446744073709551614 = 0 +quot -2 85070591730234615847396907784232501249 = 0 +quot -9223372036854775808 1 = -9223372036854775808 +quot -9223372036854775808 -1 = 9223372036854775808 +quot -9223372036854775808 2 = -4611686018427387904 +quot -9223372036854775808 -2 = 4611686018427387904 +quot -9223372036854775808 -9223372036854775808 = 1 +quot -9223372036854775808 9223372036854775807 = -1 +quot -9223372036854775808 -9223372036854775809 = 0 +quot -9223372036854775808 9223372036854775808 = -1 +quot -9223372036854775808 18446744073709551614 = 0 +quot -9223372036854775808 85070591730234615847396907784232501249 = 0 +quot 9223372036854775807 1 = 9223372036854775807 +quot 9223372036854775807 -1 = -9223372036854775807 +quot 9223372036854775807 2 = 4611686018427387903 +quot 9223372036854775807 -2 = -4611686018427387903 +quot 9223372036854775807 -9223372036854775808 = 0 +quot 9223372036854775807 9223372036854775807 = 1 +quot 9223372036854775807 -9223372036854775809 = 0 +quot 9223372036854775807 9223372036854775808 = 0 +quot 9223372036854775807 18446744073709551614 = 0 +quot 9223372036854775807 85070591730234615847396907784232501249 = 0 +rem 0 1 = 0 +rem 0 -1 = 0 +rem 0 2 = 0 +rem 0 -2 = 0 +rem 0 -9223372036854775808 = 0 +rem 0 9223372036854775807 = 0 +rem 0 -9223372036854775809 = 0 +rem 0 9223372036854775808 = 0 +rem 0 18446744073709551614 = 0 +rem 0 85070591730234615847396907784232501249 = 0 +rem 1 1 = 0 +rem 1 -1 = 0 +rem 1 2 = 1 +rem 1 -2 = 1 +rem 1 -9223372036854775808 = 1 +rem 1 9223372036854775807 = 1 +rem 1 -9223372036854775809 = 1 +rem 1 9223372036854775808 = 1 +rem 1 18446744073709551614 = 1 +rem 1 85070591730234615847396907784232501249 = 1 +rem -1 1 = 0 +rem -1 -1 = 0 +rem -1 2 = -1 +rem -1 -2 = -1 +rem -1 -9223372036854775808 = -1 +rem -1 9223372036854775807 = -1 +rem -1 -9223372036854775809 = -1 +rem -1 9223372036854775808 = -1 +rem -1 18446744073709551614 = -1 +rem -1 85070591730234615847396907784232501249 = -1 +rem 2 1 = 0 +rem 2 -1 = 0 +rem 2 2 = 0 +rem 2 -2 = 0 +rem 2 -9223372036854775808 = 2 +rem 2 9223372036854775807 = 2 +rem 2 -9223372036854775809 = 2 +rem 2 9223372036854775808 = 2 +rem 2 18446744073709551614 = 2 +rem 2 85070591730234615847396907784232501249 = 2 +rem -2 1 = 0 +rem -2 -1 = 0 +rem -2 2 = 0 +rem -2 -2 = 0 +rem -2 -9223372036854775808 = -2 +rem -2 9223372036854775807 = -2 +rem -2 -9223372036854775809 = -2 +rem -2 9223372036854775808 = -2 +rem -2 18446744073709551614 = -2 +rem -2 85070591730234615847396907784232501249 = -2 +rem -9223372036854775808 1 = 0 +rem -9223372036854775808 -1 = 0 +rem -9223372036854775808 2 = 0 +rem -9223372036854775808 -2 = 0 +rem -9223372036854775808 -9223372036854775808 = 0 +rem -9223372036854775808 9223372036854775807 = -1 +rem -9223372036854775808 -9223372036854775809 = -9223372036854775808 +rem -9223372036854775808 9223372036854775808 = 0 +rem -9223372036854775808 18446744073709551614 = -9223372036854775808 +rem -9223372036854775808 85070591730234615847396907784232501249 = -9223372036854775808 +rem 9223372036854775807 1 = 0 +rem 9223372036854775807 -1 = 0 +rem 9223372036854775807 2 = 1 +rem 9223372036854775807 -2 = 1 +rem 9223372036854775807 -9223372036854775808 = 9223372036854775807 +rem 9223372036854775807 9223372036854775807 = 0 +rem 9223372036854775807 -9223372036854775809 = 9223372036854775807 +rem 9223372036854775807 9223372036854775808 = 9223372036854775807 +rem 9223372036854775807 18446744073709551614 = 9223372036854775807 +rem 9223372036854775807 85070591730234615847396907784232501249 = 9223372036854775807 +gcd 0 1 = 1 +gcd 0 -1 = 1 +gcd 0 2 = 2 +gcd 0 -2 = 2 +gcd 0 -9223372036854775808 = 9223372036854775808 +gcd 0 9223372036854775807 = 9223372036854775807 +gcd 1 0 = 1 +gcd 1 1 = 1 +gcd 1 -1 = 1 +gcd 1 2 = 1 +gcd 1 -2 = 1 +gcd 1 -9223372036854775808 = 1 +gcd 1 9223372036854775807 = 1 +gcd -1 0 = 1 +gcd -1 1 = 1 +gcd -1 -1 = 1 +gcd -1 2 = 1 +gcd -1 -2 = 1 +gcd -1 -9223372036854775808 = 1 +gcd -1 9223372036854775807 = 1 +gcd 2 0 = 2 +gcd 2 1 = 1 +gcd 2 -1 = 1 +gcd 2 2 = 2 +gcd 2 -2 = 2 +gcd 2 -9223372036854775808 = 2 +gcd 2 9223372036854775807 = 1 +gcd -2 0 = 2 +gcd -2 1 = 1 +gcd -2 -1 = 1 +gcd -2 2 = 2 +gcd -2 -2 = 2 +gcd -2 -9223372036854775808 = 2 +gcd -2 9223372036854775807 = 1 +gcd -9223372036854775808 0 = 9223372036854775808 +gcd -9223372036854775808 1 = 1 +gcd -9223372036854775808 -1 = 1 +gcd -9223372036854775808 2 = 2 +gcd -9223372036854775808 -2 = 2 +gcd -9223372036854775808 -9223372036854775808 = 9223372036854775808 +gcd -9223372036854775808 9223372036854775807 = 1 +gcd 9223372036854775807 0 = 9223372036854775807 +gcd 9223372036854775807 1 = 1 +gcd 9223372036854775807 -1 = 1 +gcd 9223372036854775807 2 = 1 +gcd 9223372036854775807 -2 = 1 +gcd 9223372036854775807 -9223372036854775808 = 1 +gcd 9223372036854775807 9223372036854775807 = 9223372036854775807 +lcm 0 1 = 0 +lcm 0 -1 = 0 +lcm 0 2 = 0 +lcm 0 -2 = 0 +lcm 0 -9223372036854775808 = 0 +lcm 0 9223372036854775807 = 0 +lcm 1 0 = 0 +lcm 1 1 = 1 +lcm 1 -1 = 1 +lcm 1 2 = 2 +lcm 1 -2 = 2 +lcm 1 -9223372036854775808 = 9223372036854775808 +lcm 1 9223372036854775807 = 9223372036854775807 +lcm -1 0 = 0 +lcm -1 1 = 1 +lcm -1 -1 = 1 +lcm -1 2 = 2 +lcm -1 -2 = 2 +lcm -1 -9223372036854775808 = 9223372036854775808 +lcm -1 9223372036854775807 = 9223372036854775807 +lcm 2 0 = 0 +lcm 2 1 = 2 +lcm 2 -1 = 2 +lcm 2 2 = 2 +lcm 2 -2 = 2 +lcm 2 -9223372036854775808 = 9223372036854775808 +lcm 2 9223372036854775807 = 18446744073709551614 +lcm -2 0 = 0 +lcm -2 1 = 2 +lcm -2 -1 = 2 +lcm -2 2 = 2 +lcm -2 -2 = 2 +lcm -2 -9223372036854775808 = 9223372036854775808 +lcm -2 9223372036854775807 = 18446744073709551614 +lcm -9223372036854775808 0 = 0 +lcm -9223372036854775808 1 = 9223372036854775808 +lcm -9223372036854775808 -1 = 9223372036854775808 +lcm -9223372036854775808 2 = 9223372036854775808 +lcm -9223372036854775808 -2 = 9223372036854775808 +lcm -9223372036854775808 -9223372036854775808 = 9223372036854775808 +lcm -9223372036854775808 9223372036854775807 = 85070591730234615856620279821087277056 +lcm 9223372036854775807 0 = 0 +lcm 9223372036854775807 1 = 9223372036854775807 +lcm 9223372036854775807 -1 = 9223372036854775807 +lcm 9223372036854775807 2 = 18446744073709551614 +lcm 9223372036854775807 -2 = 18446744073709551614 +lcm 9223372036854775807 -9223372036854775808 = 85070591730234615856620279821087277056 +lcm 9223372036854775807 9223372036854775807 = 9223372036854775807 diff --git a/testsuite/tests/numeric/should_run/arith003.stdout-mips-sgi-irix b/testsuite/tests/numeric/should_run/arith003.stdout-mips-sgi-irix new file mode 100644 index 0000000000..9ea4a0f2eb --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith003.stdout-mips-sgi-irix @@ -0,0 +1,1053 @@ +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -9223372036854775808 = -9223372036854775808 +(+) 0 9223372036854775807 = 9223372036854775807 +(+) 1 0 = 1 +(+) 1 1 = 2 +(+) 1 -1 = 0 +(+) 1 2 = 3 +(+) 1 -2 = -1 +(+) 1 -9223372036854775808 = -9223372036854775807 +(+) 1 9223372036854775807 = -9223372036854775808 +(+) -1 0 = -1 +(+) -1 1 = 0 +(+) -1 -1 = -2 +(+) -1 2 = 1 +(+) -1 -2 = -3 +(+) -1 -9223372036854775808 = 9223372036854775807 +(+) -1 9223372036854775807 = 9223372036854775806 +(+) 2 0 = 2 +(+) 2 1 = 3 +(+) 2 -1 = 1 +(+) 2 2 = 4 +(+) 2 -2 = 0 +(+) 2 -9223372036854775808 = -9223372036854775806 +(+) 2 9223372036854775807 = -9223372036854775807 +(+) -2 0 = -2 +(+) -2 1 = -1 +(+) -2 -1 = -3 +(+) -2 2 = 0 +(+) -2 -2 = -4 +(+) -2 -9223372036854775808 = 9223372036854775806 +(+) -2 9223372036854775807 = 9223372036854775805 +(+) -9223372036854775808 0 = -9223372036854775808 +(+) -9223372036854775808 1 = -9223372036854775807 +(+) -9223372036854775808 -1 = 9223372036854775807 +(+) -9223372036854775808 2 = -9223372036854775806 +(+) -9223372036854775808 -2 = 9223372036854775806 +(+) -9223372036854775808 -9223372036854775808 = 0 +(+) -9223372036854775808 9223372036854775807 = -1 +(+) 9223372036854775807 0 = 9223372036854775807 +(+) 9223372036854775807 1 = -9223372036854775808 +(+) 9223372036854775807 -1 = 9223372036854775806 +(+) 9223372036854775807 2 = -9223372036854775807 +(+) 9223372036854775807 -2 = 9223372036854775805 +(+) 9223372036854775807 -9223372036854775808 = -1 +(+) 9223372036854775807 9223372036854775807 = -2 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -9223372036854775808 = -9223372036854775808 +(-) 0 9223372036854775807 = -9223372036854775807 +(-) 1 0 = 1 +(-) 1 1 = 0 +(-) 1 -1 = 2 +(-) 1 2 = -1 +(-) 1 -2 = 3 +(-) 1 -9223372036854775808 = -9223372036854775807 +(-) 1 9223372036854775807 = -9223372036854775806 +(-) -1 0 = -1 +(-) -1 1 = -2 +(-) -1 -1 = 0 +(-) -1 2 = -3 +(-) -1 -2 = 1 +(-) -1 -9223372036854775808 = 9223372036854775807 +(-) -1 9223372036854775807 = -9223372036854775808 +(-) 2 0 = 2 +(-) 2 1 = 1 +(-) 2 -1 = 3 +(-) 2 2 = 0 +(-) 2 -2 = 4 +(-) 2 -9223372036854775808 = -9223372036854775806 +(-) 2 9223372036854775807 = -9223372036854775805 +(-) -2 0 = -2 +(-) -2 1 = -3 +(-) -2 -1 = -1 +(-) -2 2 = -4 +(-) -2 -2 = 0 +(-) -2 -9223372036854775808 = 9223372036854775806 +(-) -2 9223372036854775807 = 9223372036854775807 +(-) -9223372036854775808 0 = -9223372036854775808 +(-) -9223372036854775808 1 = 9223372036854775807 +(-) -9223372036854775808 -1 = -9223372036854775807 +(-) -9223372036854775808 2 = 9223372036854775806 +(-) -9223372036854775808 -2 = -9223372036854775806 +(-) -9223372036854775808 -9223372036854775808 = 0 +(-) -9223372036854775808 9223372036854775807 = 1 +(-) 9223372036854775807 0 = 9223372036854775807 +(-) 9223372036854775807 1 = 9223372036854775806 +(-) 9223372036854775807 -1 = -9223372036854775808 +(-) 9223372036854775807 2 = 9223372036854775805 +(-) 9223372036854775807 -2 = -9223372036854775807 +(-) 9223372036854775807 -9223372036854775808 = -1 +(-) 9223372036854775807 9223372036854775807 = 0 +(^) 0 0 = 1 +(^) 0 1 = 0 +(^) 0 2 = 0 +(^) 1 0 = 1 +(^) 1 1 = 1 +(^) 1 2 = 1 +(^) -1 0 = 1 +(^) -1 1 = -1 +(^) -1 2 = 1 +(^) 2 0 = 1 +(^) 2 1 = 2 +(^) 2 2 = 4 +(^) -2 0 = 1 +(^) -2 1 = -2 +(^) -2 2 = 4 +(^) -9223372036854775808 0 = 1 +(^) -9223372036854775808 1 = -9223372036854775808 +(^) -9223372036854775808 2 = 0 +(^) 9223372036854775807 0 = 1 +(^) 9223372036854775807 1 = 9223372036854775807 +(^) 9223372036854775807 2 = 1 +div 0 1 = 0 +div 0 -1 = 0 +div 0 2 = 0 +div 0 -2 = 0 +div 0 -9223372036854775808 = 0 +div 0 9223372036854775807 = 0 +div 1 1 = 1 +div 1 -1 = -1 +div 1 2 = 0 +div 1 -2 = -1 +div 1 -9223372036854775808 = -1 +div 1 9223372036854775807 = 0 +div -1 1 = -1 +div -1 -1 = 1 +div -1 2 = -1 +div -1 -2 = 0 +div -1 -9223372036854775808 = 0 +div -1 9223372036854775807 = -1 +div 2 1 = 2 +div 2 -1 = -2 +div 2 2 = 1 +div 2 -2 = -1 +div 2 -9223372036854775808 = -1 +div 2 9223372036854775807 = 0 +div -2 1 = -2 +div -2 -1 = 2 +div -2 2 = -1 +div -2 -2 = 1 +div -2 -9223372036854775808 = 0 +div -2 9223372036854775807 = -1 +div 9223372036854775807 1 = 9223372036854775807 +div 9223372036854775807 -1 = -9223372036854775807 +div 9223372036854775807 2 = 4611686018427387903 +div 9223372036854775807 -2 = -4611686018427387904 +div 9223372036854775807 -9223372036854775808 = -1 +div 9223372036854775807 9223372036854775807 = 1 +mod 0 1 = 0 +mod 0 -1 = 0 +mod 0 2 = 0 +mod 0 -2 = 0 +mod 0 -9223372036854775808 = 0 +mod 0 9223372036854775807 = 0 +mod 1 1 = 0 +mod 1 -1 = 0 +mod 1 2 = 1 +mod 1 -2 = -1 +mod 1 -9223372036854775808 = -9223372036854775807 +mod 1 9223372036854775807 = 1 +mod -1 1 = 0 +mod -1 -1 = 0 +mod -1 2 = 1 +mod -1 -2 = -1 +mod -1 -9223372036854775808 = -1 +mod -1 9223372036854775807 = 9223372036854775806 +mod 2 1 = 0 +mod 2 -1 = 0 +mod 2 2 = 0 +mod 2 -2 = 0 +mod 2 -9223372036854775808 = -9223372036854775806 +mod 2 9223372036854775807 = 2 +mod -2 1 = 0 +mod -2 -1 = 0 +mod -2 2 = 0 +mod -2 -2 = 0 +mod -2 -9223372036854775808 = -2 +mod -2 9223372036854775807 = 9223372036854775805 +mod 9223372036854775807 1 = 0 +mod 9223372036854775807 -1 = 0 +mod 9223372036854775807 2 = 1 +mod 9223372036854775807 -2 = -1 +mod 9223372036854775807 -9223372036854775808 = -1 +mod 9223372036854775807 9223372036854775807 = 0 +quot 0 1 = 0 +quot 0 -1 = 0 +quot 0 2 = 0 +quot 0 -2 = 0 +quot 0 -9223372036854775808 = 0 +quot 0 9223372036854775807 = 0 +quot 1 1 = 1 +quot 1 -1 = -1 +quot 1 2 = 0 +quot 1 -2 = 0 +quot 1 -9223372036854775808 = 0 +quot 1 9223372036854775807 = 0 +quot -1 1 = -1 +quot -1 -1 = 1 +quot -1 2 = 0 +quot -1 -2 = 0 +quot -1 -9223372036854775808 = 0 +quot -1 9223372036854775807 = 0 +quot 2 1 = 2 +quot 2 -1 = -2 +quot 2 2 = 1 +quot 2 -2 = -1 +quot 2 -9223372036854775808 = 0 +quot 2 9223372036854775807 = 0 +quot -2 1 = -2 +quot -2 -1 = 2 +quot -2 2 = -1 +quot -2 -2 = 1 +quot -2 -9223372036854775808 = 0 +quot -2 9223372036854775807 = 0 +quot 9223372036854775807 1 = 9223372036854775807 +quot 9223372036854775807 -1 = -9223372036854775807 +quot 9223372036854775807 2 = 4611686018427387903 +quot 9223372036854775807 -2 = -4611686018427387903 +quot 9223372036854775807 -9223372036854775808 = 0 +quot 9223372036854775807 9223372036854775807 = 1 +rem 0 1 = 0 +rem 0 -1 = 0 +rem 0 2 = 0 +rem 0 -2 = 0 +rem 0 -9223372036854775808 = 0 +rem 0 9223372036854775807 = 0 +rem 1 1 = 0 +rem 1 -1 = 0 +rem 1 2 = 1 +rem 1 -2 = 1 +rem 1 -9223372036854775808 = 1 +rem 1 9223372036854775807 = 1 +rem -1 1 = 0 +rem -1 -1 = 0 +rem -1 2 = -1 +rem -1 -2 = -1 +rem -1 -9223372036854775808 = -1 +rem -1 9223372036854775807 = -1 +rem 2 1 = 0 +rem 2 -1 = 0 +rem 2 2 = 0 +rem 2 -2 = 0 +rem 2 -9223372036854775808 = 2 +rem 2 9223372036854775807 = 2 +rem -2 1 = 0 +rem -2 -1 = 0 +rem -2 2 = 0 +rem -2 -2 = 0 +rem -2 -9223372036854775808 = -2 +rem -2 9223372036854775807 = -2 +rem 9223372036854775807 1 = 0 +rem 9223372036854775807 -1 = 0 +rem 9223372036854775807 2 = 1 +rem 9223372036854775807 -2 = 1 +rem 9223372036854775807 -9223372036854775808 = 9223372036854775807 +rem 9223372036854775807 9223372036854775807 = 0 +gcd 0 1 = 1 +gcd 0 -1 = 1 +gcd 0 2 = 2 +gcd 0 -2 = 2 +gcd 0 9223372036854775807 = 9223372036854775807 +gcd 1 0 = 1 +gcd 1 1 = 1 +gcd 1 -1 = 1 +gcd 1 2 = 1 +gcd 1 -2 = 1 +gcd 1 9223372036854775807 = 1 +gcd -1 0 = 1 +gcd -1 1 = 1 +gcd -1 -1 = 1 +gcd -1 2 = 1 +gcd -1 -2 = 1 +gcd -1 9223372036854775807 = 1 +gcd 2 0 = 2 +gcd 2 1 = 1 +gcd 2 -1 = 1 +gcd 2 2 = 2 +gcd 2 -2 = 2 +gcd 2 9223372036854775807 = 1 +gcd -2 0 = 2 +gcd -2 1 = 1 +gcd -2 -1 = 1 +gcd -2 2 = 2 +gcd -2 -2 = 2 +gcd -2 9223372036854775807 = 1 +gcd 9223372036854775807 0 = 9223372036854775807 +gcd 9223372036854775807 1 = 1 +gcd 9223372036854775807 -1 = 1 +gcd 9223372036854775807 2 = 1 +gcd 9223372036854775807 -2 = 1 +gcd 9223372036854775807 9223372036854775807 = 9223372036854775807 +lcm 0 1 = 0 +lcm 0 -1 = 0 +lcm 0 2 = 0 +lcm 0 -2 = 0 +lcm 0 -9223372036854775808 = 0 +lcm 1 0 = 0 +lcm 1 1 = 1 +lcm 1 -1 = 1 +lcm 1 2 = 2 +lcm 1 -2 = 2 +lcm 1 -9223372036854775808 = -9223372036854775808 +lcm -1 0 = 0 +lcm -1 1 = 1 +lcm -1 -1 = 1 +lcm -1 2 = 2 +lcm -1 -2 = 2 +lcm -1 -9223372036854775808 = -9223372036854775808 +lcm 2 0 = 0 +lcm 2 1 = 2 +lcm 2 -1 = 2 +lcm 2 2 = 2 +lcm 2 -2 = 2 +lcm 2 -9223372036854775808 = -9223372036854775808 +lcm -2 0 = 0 +lcm -2 1 = 2 +lcm -2 -1 = 2 +lcm -2 2 = 2 +lcm -2 -2 = 2 +lcm -2 -9223372036854775808 = -9223372036854775808 +lcm -9223372036854775808 0 = 0 +lcm -9223372036854775808 1 = -9223372036854775808 +lcm -9223372036854775808 -1 = -9223372036854775808 +lcm -9223372036854775808 2 = -9223372036854775808 +lcm -9223372036854775808 -2 = -9223372036854775808 +lcm -9223372036854775808 -9223372036854775808 = -9223372036854775808 +lcm 9223372036854775807 0 = 0 +lcm 9223372036854775807 1 = 9223372036854775807 +lcm 9223372036854775807 -1 = 9223372036854775807 +lcm 9223372036854775807 2 = 2 +lcm 9223372036854775807 -2 = 2 +lcm 9223372036854775807 -9223372036854775808 = -9223372036854775808 +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -9223372036854775808 = -9223372036854775808 +(+) 0 9223372036854775807 = 9223372036854775807 +(+) 0 -9223372036854775809 = -9223372036854775809 +(+) 0 9223372036854775808 = 9223372036854775808 +(+) 0 0 = 0 +(+) 0 18446744073709551614 = 18446744073709551614 +(+) 0 0 = 0 +(+) 0 85070591730234615847396907784232501249 = 85070591730234615847396907784232501249 +(+) 1 0 = 1 +(+) 1 1 = 2 +(+) 1 -1 = 0 +(+) 1 2 = 3 +(+) 1 -2 = -1 +(+) 1 -9223372036854775808 = -9223372036854775807 +(+) 1 9223372036854775807 = 9223372036854775808 +(+) 1 -9223372036854775809 = -9223372036854775808 +(+) 1 9223372036854775808 = 9223372036854775809 +(+) 1 0 = 1 +(+) 1 18446744073709551614 = 18446744073709551615 +(+) 1 0 = 1 +(+) 1 85070591730234615847396907784232501249 = 85070591730234615847396907784232501250 +(+) -1 0 = -1 +(+) -1 1 = 0 +(+) -1 -1 = -2 +(+) -1 2 = 1 +(+) -1 -2 = -3 +(+) -1 -9223372036854775808 = -9223372036854775809 +(+) -1 9223372036854775807 = 9223372036854775806 +(+) -1 -9223372036854775809 = -9223372036854775810 +(+) -1 9223372036854775808 = 9223372036854775807 +(+) -1 0 = -1 +(+) -1 18446744073709551614 = 18446744073709551613 +(+) -1 0 = -1 +(+) -1 85070591730234615847396907784232501249 = 85070591730234615847396907784232501248 +(+) 2 0 = 2 +(+) 2 1 = 3 +(+) 2 -1 = 1 +(+) 2 2 = 4 +(+) 2 -2 = 0 +(+) 2 -9223372036854775808 = -9223372036854775806 +(+) 2 9223372036854775807 = 9223372036854775809 +(+) 2 -9223372036854775809 = -9223372036854775807 +(+) 2 9223372036854775808 = 9223372036854775810 +(+) 2 0 = 2 +(+) 2 18446744073709551614 = 18446744073709551616 +(+) 2 0 = 2 +(+) 2 85070591730234615847396907784232501249 = 85070591730234615847396907784232501251 +(+) -2 0 = -2 +(+) -2 1 = -1 +(+) -2 -1 = -3 +(+) -2 2 = 0 +(+) -2 -2 = -4 +(+) -2 -9223372036854775808 = -9223372036854775810 +(+) -2 9223372036854775807 = 9223372036854775805 +(+) -2 -9223372036854775809 = -9223372036854775811 +(+) -2 9223372036854775808 = 9223372036854775806 +(+) -2 0 = -2 +(+) -2 18446744073709551614 = 18446744073709551612 +(+) -2 0 = -2 +(+) -2 85070591730234615847396907784232501249 = 85070591730234615847396907784232501247 +(+) -9223372036854775808 0 = -9223372036854775808 +(+) -9223372036854775808 1 = -9223372036854775807 +(+) -9223372036854775808 -1 = -9223372036854775809 +(+) -9223372036854775808 2 = -9223372036854775806 +(+) -9223372036854775808 -2 = -9223372036854775810 +(+) -9223372036854775808 -9223372036854775808 = -18446744073709551616 +(+) -9223372036854775808 9223372036854775807 = -1 +(+) -9223372036854775808 -9223372036854775809 = -18446744073709551617 +(+) -9223372036854775808 9223372036854775808 = 0 +(+) -9223372036854775808 0 = -9223372036854775808 +(+) -9223372036854775808 18446744073709551614 = 9223372036854775806 +(+) -9223372036854775808 0 = -9223372036854775808 +(+) -9223372036854775808 85070591730234615847396907784232501249 = 85070591730234615838173535747377725441 +(+) 9223372036854775807 0 = 9223372036854775807 +(+) 9223372036854775807 1 = 9223372036854775808 +(+) 9223372036854775807 -1 = 9223372036854775806 +(+) 9223372036854775807 2 = 9223372036854775809 +(+) 9223372036854775807 -2 = 9223372036854775805 +(+) 9223372036854775807 -9223372036854775808 = -1 +(+) 9223372036854775807 9223372036854775807 = 18446744073709551614 +(+) 9223372036854775807 -9223372036854775809 = -2 +(+) 9223372036854775807 9223372036854775808 = 18446744073709551615 +(+) 9223372036854775807 0 = 9223372036854775807 +(+) 9223372036854775807 18446744073709551614 = 27670116110564327421 +(+) 9223372036854775807 0 = 9223372036854775807 +(+) 9223372036854775807 85070591730234615847396907784232501249 = 85070591730234615856620279821087277056 +(+) -9223372036854775809 0 = -9223372036854775809 +(+) -9223372036854775809 1 = -9223372036854775808 +(+) -9223372036854775809 -1 = -9223372036854775810 +(+) -9223372036854775809 2 = -9223372036854775807 +(+) -9223372036854775809 -2 = -9223372036854775811 +(+) -9223372036854775809 -9223372036854775808 = -18446744073709551617 +(+) -9223372036854775809 9223372036854775807 = -2 +(+) -9223372036854775809 -9223372036854775809 = -18446744073709551618 +(+) -9223372036854775809 9223372036854775808 = -1 +(+) -9223372036854775809 0 = -9223372036854775809 +(+) -9223372036854775809 18446744073709551614 = 9223372036854775805 +(+) -9223372036854775809 0 = -9223372036854775809 +(+) -9223372036854775809 85070591730234615847396907784232501249 = 85070591730234615838173535747377725440 +(+) 9223372036854775808 0 = 9223372036854775808 +(+) 9223372036854775808 1 = 9223372036854775809 +(+) 9223372036854775808 -1 = 9223372036854775807 +(+) 9223372036854775808 2 = 9223372036854775810 +(+) 9223372036854775808 -2 = 9223372036854775806 +(+) 9223372036854775808 -9223372036854775808 = 0 +(+) 9223372036854775808 9223372036854775807 = 18446744073709551615 +(+) 9223372036854775808 -9223372036854775809 = -1 +(+) 9223372036854775808 9223372036854775808 = 18446744073709551616 +(+) 9223372036854775808 0 = 9223372036854775808 +(+) 9223372036854775808 18446744073709551614 = 27670116110564327422 +(+) 9223372036854775808 0 = 9223372036854775808 +(+) 9223372036854775808 85070591730234615847396907784232501249 = 85070591730234615856620279821087277057 +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -9223372036854775808 = -9223372036854775808 +(+) 0 9223372036854775807 = 9223372036854775807 +(+) 0 -9223372036854775809 = -9223372036854775809 +(+) 0 9223372036854775808 = 9223372036854775808 +(+) 0 0 = 0 +(+) 0 18446744073709551614 = 18446744073709551614 +(+) 0 0 = 0 +(+) 0 85070591730234615847396907784232501249 = 85070591730234615847396907784232501249 +(+) 18446744073709551614 0 = 18446744073709551614 +(+) 18446744073709551614 1 = 18446744073709551615 +(+) 18446744073709551614 -1 = 18446744073709551613 +(+) 18446744073709551614 2 = 18446744073709551616 +(+) 18446744073709551614 -2 = 18446744073709551612 +(+) 18446744073709551614 -9223372036854775808 = 9223372036854775806 +(+) 18446744073709551614 9223372036854775807 = 27670116110564327421 +(+) 18446744073709551614 -9223372036854775809 = 9223372036854775805 +(+) 18446744073709551614 9223372036854775808 = 27670116110564327422 +(+) 18446744073709551614 0 = 18446744073709551614 +(+) 18446744073709551614 18446744073709551614 = 36893488147419103228 +(+) 18446744073709551614 0 = 18446744073709551614 +(+) 18446744073709551614 85070591730234615847396907784232501249 = 85070591730234615865843651857942052863 +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -9223372036854775808 = -9223372036854775808 +(+) 0 9223372036854775807 = 9223372036854775807 +(+) 0 -9223372036854775809 = -9223372036854775809 +(+) 0 9223372036854775808 = 9223372036854775808 +(+) 0 0 = 0 +(+) 0 18446744073709551614 = 18446744073709551614 +(+) 0 0 = 0 +(+) 0 85070591730234615847396907784232501249 = 85070591730234615847396907784232501249 +(+) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(+) 85070591730234615847396907784232501249 1 = 85070591730234615847396907784232501250 +(+) 85070591730234615847396907784232501249 -1 = 85070591730234615847396907784232501248 +(+) 85070591730234615847396907784232501249 2 = 85070591730234615847396907784232501251 +(+) 85070591730234615847396907784232501249 -2 = 85070591730234615847396907784232501247 +(+) 85070591730234615847396907784232501249 -9223372036854775808 = 85070591730234615838173535747377725441 +(+) 85070591730234615847396907784232501249 9223372036854775807 = 85070591730234615856620279821087277056 +(+) 85070591730234615847396907784232501249 -9223372036854775809 = 85070591730234615838173535747377725440 +(+) 85070591730234615847396907784232501249 9223372036854775808 = 85070591730234615856620279821087277057 +(+) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(+) 85070591730234615847396907784232501249 18446744073709551614 = 85070591730234615865843651857942052863 +(+) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(+) 85070591730234615847396907784232501249 85070591730234615847396907784232501249 = 170141183460469231694793815568465002498 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -9223372036854775808 = 9223372036854775808 +(-) 0 9223372036854775807 = -9223372036854775807 +(-) 0 -9223372036854775809 = 9223372036854775809 +(-) 0 9223372036854775808 = -9223372036854775808 +(-) 0 0 = 0 +(-) 0 18446744073709551614 = -18446744073709551614 +(-) 0 0 = 0 +(-) 0 85070591730234615847396907784232501249 = -85070591730234615847396907784232501249 +(-) 1 0 = 1 +(-) 1 1 = 0 +(-) 1 -1 = 2 +(-) 1 2 = -1 +(-) 1 -2 = 3 +(-) 1 -9223372036854775808 = 9223372036854775809 +(-) 1 9223372036854775807 = -9223372036854775806 +(-) 1 -9223372036854775809 = 9223372036854775810 +(-) 1 9223372036854775808 = -9223372036854775807 +(-) 1 0 = 1 +(-) 1 18446744073709551614 = -18446744073709551613 +(-) 1 0 = 1 +(-) 1 85070591730234615847396907784232501249 = -85070591730234615847396907784232501248 +(-) -1 0 = -1 +(-) -1 1 = -2 +(-) -1 -1 = 0 +(-) -1 2 = -3 +(-) -1 -2 = 1 +(-) -1 -9223372036854775808 = 9223372036854775807 +(-) -1 9223372036854775807 = -9223372036854775808 +(-) -1 -9223372036854775809 = 9223372036854775808 +(-) -1 9223372036854775808 = -9223372036854775809 +(-) -1 0 = -1 +(-) -1 18446744073709551614 = -18446744073709551615 +(-) -1 0 = -1 +(-) -1 85070591730234615847396907784232501249 = -85070591730234615847396907784232501250 +(-) 2 0 = 2 +(-) 2 1 = 1 +(-) 2 -1 = 3 +(-) 2 2 = 0 +(-) 2 -2 = 4 +(-) 2 -9223372036854775808 = 9223372036854775810 +(-) 2 9223372036854775807 = -9223372036854775805 +(-) 2 -9223372036854775809 = 9223372036854775811 +(-) 2 9223372036854775808 = -9223372036854775806 +(-) 2 0 = 2 +(-) 2 18446744073709551614 = -18446744073709551612 +(-) 2 0 = 2 +(-) 2 85070591730234615847396907784232501249 = -85070591730234615847396907784232501247 +(-) -2 0 = -2 +(-) -2 1 = -3 +(-) -2 -1 = -1 +(-) -2 2 = -4 +(-) -2 -2 = 0 +(-) -2 -9223372036854775808 = 9223372036854775806 +(-) -2 9223372036854775807 = -9223372036854775809 +(-) -2 -9223372036854775809 = 9223372036854775807 +(-) -2 9223372036854775808 = -9223372036854775810 +(-) -2 0 = -2 +(-) -2 18446744073709551614 = -18446744073709551616 +(-) -2 0 = -2 +(-) -2 85070591730234615847396907784232501249 = -85070591730234615847396907784232501251 +(-) -9223372036854775808 0 = -9223372036854775808 +(-) -9223372036854775808 1 = -9223372036854775809 +(-) -9223372036854775808 -1 = -9223372036854775807 +(-) -9223372036854775808 2 = -9223372036854775810 +(-) -9223372036854775808 -2 = -9223372036854775806 +(-) -9223372036854775808 -9223372036854775808 = 0 +(-) -9223372036854775808 9223372036854775807 = -18446744073709551615 +(-) -9223372036854775808 -9223372036854775809 = 1 +(-) -9223372036854775808 9223372036854775808 = -18446744073709551616 +(-) -9223372036854775808 0 = -9223372036854775808 +(-) -9223372036854775808 18446744073709551614 = -27670116110564327422 +(-) -9223372036854775808 0 = -9223372036854775808 +(-) -9223372036854775808 85070591730234615847396907784232501249 = -85070591730234615856620279821087277057 +(-) 9223372036854775807 0 = 9223372036854775807 +(-) 9223372036854775807 1 = 9223372036854775806 +(-) 9223372036854775807 -1 = 9223372036854775808 +(-) 9223372036854775807 2 = 9223372036854775805 +(-) 9223372036854775807 -2 = 9223372036854775809 +(-) 9223372036854775807 -9223372036854775808 = 18446744073709551615 +(-) 9223372036854775807 9223372036854775807 = 0 +(-) 9223372036854775807 -9223372036854775809 = 18446744073709551616 +(-) 9223372036854775807 9223372036854775808 = -1 +(-) 9223372036854775807 0 = 9223372036854775807 +(-) 9223372036854775807 18446744073709551614 = -9223372036854775807 +(-) 9223372036854775807 0 = 9223372036854775807 +(-) 9223372036854775807 85070591730234615847396907784232501249 = -85070591730234615838173535747377725442 +(-) -9223372036854775809 0 = -9223372036854775809 +(-) -9223372036854775809 1 = -9223372036854775810 +(-) -9223372036854775809 -1 = -9223372036854775808 +(-) -9223372036854775809 2 = -9223372036854775811 +(-) -9223372036854775809 -2 = -9223372036854775807 +(-) -9223372036854775809 -9223372036854775808 = -1 +(-) -9223372036854775809 9223372036854775807 = -18446744073709551616 +(-) -9223372036854775809 -9223372036854775809 = 0 +(-) -9223372036854775809 9223372036854775808 = -18446744073709551617 +(-) -9223372036854775809 0 = -9223372036854775809 +(-) -9223372036854775809 18446744073709551614 = -27670116110564327423 +(-) -9223372036854775809 0 = -9223372036854775809 +(-) -9223372036854775809 85070591730234615847396907784232501249 = -85070591730234615856620279821087277058 +(-) 9223372036854775808 0 = 9223372036854775808 +(-) 9223372036854775808 1 = 9223372036854775807 +(-) 9223372036854775808 -1 = 9223372036854775809 +(-) 9223372036854775808 2 = 9223372036854775806 +(-) 9223372036854775808 -2 = 9223372036854775810 +(-) 9223372036854775808 -9223372036854775808 = 18446744073709551616 +(-) 9223372036854775808 9223372036854775807 = 1 +(-) 9223372036854775808 -9223372036854775809 = 18446744073709551617 +(-) 9223372036854775808 9223372036854775808 = 0 +(-) 9223372036854775808 0 = 9223372036854775808 +(-) 9223372036854775808 18446744073709551614 = -9223372036854775806 +(-) 9223372036854775808 0 = 9223372036854775808 +(-) 9223372036854775808 85070591730234615847396907784232501249 = -85070591730234615838173535747377725441 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -9223372036854775808 = 9223372036854775808 +(-) 0 9223372036854775807 = -9223372036854775807 +(-) 0 -9223372036854775809 = 9223372036854775809 +(-) 0 9223372036854775808 = -9223372036854775808 +(-) 0 0 = 0 +(-) 0 18446744073709551614 = -18446744073709551614 +(-) 0 0 = 0 +(-) 0 85070591730234615847396907784232501249 = -85070591730234615847396907784232501249 +(-) 18446744073709551614 0 = 18446744073709551614 +(-) 18446744073709551614 1 = 18446744073709551613 +(-) 18446744073709551614 -1 = 18446744073709551615 +(-) 18446744073709551614 2 = 18446744073709551612 +(-) 18446744073709551614 -2 = 18446744073709551616 +(-) 18446744073709551614 -9223372036854775808 = 27670116110564327422 +(-) 18446744073709551614 9223372036854775807 = 9223372036854775807 +(-) 18446744073709551614 -9223372036854775809 = 27670116110564327423 +(-) 18446744073709551614 9223372036854775808 = 9223372036854775806 +(-) 18446744073709551614 0 = 18446744073709551614 +(-) 18446744073709551614 18446744073709551614 = 0 +(-) 18446744073709551614 0 = 18446744073709551614 +(-) 18446744073709551614 85070591730234615847396907784232501249 = -85070591730234615828950163710522949635 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -9223372036854775808 = 9223372036854775808 +(-) 0 9223372036854775807 = -9223372036854775807 +(-) 0 -9223372036854775809 = 9223372036854775809 +(-) 0 9223372036854775808 = -9223372036854775808 +(-) 0 0 = 0 +(-) 0 18446744073709551614 = -18446744073709551614 +(-) 0 0 = 0 +(-) 0 85070591730234615847396907784232501249 = -85070591730234615847396907784232501249 +(-) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(-) 85070591730234615847396907784232501249 1 = 85070591730234615847396907784232501248 +(-) 85070591730234615847396907784232501249 -1 = 85070591730234615847396907784232501250 +(-) 85070591730234615847396907784232501249 2 = 85070591730234615847396907784232501247 +(-) 85070591730234615847396907784232501249 -2 = 85070591730234615847396907784232501251 +(-) 85070591730234615847396907784232501249 -9223372036854775808 = 85070591730234615856620279821087277057 +(-) 85070591730234615847396907784232501249 9223372036854775807 = 85070591730234615838173535747377725442 +(-) 85070591730234615847396907784232501249 -9223372036854775809 = 85070591730234615856620279821087277058 +(-) 85070591730234615847396907784232501249 9223372036854775808 = 85070591730234615838173535747377725441 +(-) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(-) 85070591730234615847396907784232501249 18446744073709551614 = 85070591730234615828950163710522949635 +(-) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(-) 85070591730234615847396907784232501249 85070591730234615847396907784232501249 = 0 +div 0 1 = 0 +div 0 -1 = 0 +div 0 2 = 0 +div 0 -2 = 0 +div 0 -9223372036854775808 = 0 +div 0 9223372036854775807 = 0 +div 0 -9223372036854775809 = 0 +div 0 9223372036854775808 = 0 +div 0 18446744073709551614 = 0 +div 0 85070591730234615847396907784232501249 = 0 +div 1 1 = 1 +div 1 -1 = -1 +div 1 2 = 0 +div 1 -2 = -1 +div 1 -9223372036854775808 = -1 +div 1 9223372036854775807 = 0 +div 1 -9223372036854775809 = -1 +div 1 9223372036854775808 = 0 +div 1 18446744073709551614 = 0 +div 1 85070591730234615847396907784232501249 = 0 +div -1 1 = -1 +div -1 -1 = 1 +div -1 2 = -1 +div -1 -2 = 0 +div -1 -9223372036854775808 = 0 +div -1 9223372036854775807 = -1 +div -1 -9223372036854775809 = 0 +div -1 9223372036854775808 = -1 +div -1 18446744073709551614 = -1 +div -1 85070591730234615847396907784232501249 = -1 +div 2 1 = 2 +div 2 -1 = -2 +div 2 2 = 1 +div 2 -2 = -1 +div 2 -9223372036854775808 = -1 +div 2 9223372036854775807 = 0 +div 2 -9223372036854775809 = -1 +div 2 9223372036854775808 = 0 +div 2 18446744073709551614 = 0 +div 2 85070591730234615847396907784232501249 = 0 +div -2 1 = -2 +div -2 -1 = 2 +div -2 2 = -1 +div -2 -2 = 1 +div -2 -9223372036854775808 = 0 +div -2 9223372036854775807 = -1 +div -2 -9223372036854775809 = 0 +div -2 9223372036854775808 = -1 +div -2 18446744073709551614 = -1 +div -2 85070591730234615847396907784232501249 = -1 +div -9223372036854775808 1 = -9223372036854775808 +div -9223372036854775808 -1 = 9223372036854775808 +div -9223372036854775808 2 = -4611686018427387904 +div -9223372036854775808 -2 = 4611686018427387904 +div -9223372036854775808 -9223372036854775808 = 1 +div -9223372036854775808 9223372036854775807 = -2 +div -9223372036854775808 -9223372036854775809 = 0 +div -9223372036854775808 9223372036854775808 = -1 +div -9223372036854775808 18446744073709551614 = -1 +div -9223372036854775808 85070591730234615847396907784232501249 = -1 +div 9223372036854775807 1 = 9223372036854775807 +div 9223372036854775807 -1 = -9223372036854775807 +div 9223372036854775807 2 = 4611686018427387903 +div 9223372036854775807 -2 = -4611686018427387904 +div 9223372036854775807 -9223372036854775808 = -1 +div 9223372036854775807 9223372036854775807 = 1 +div 9223372036854775807 -9223372036854775809 = -1 +div 9223372036854775807 9223372036854775808 = 0 +div 9223372036854775807 18446744073709551614 = 0 +div 9223372036854775807 85070591730234615847396907784232501249 = 0 +mod 0 1 = 0 +mod 0 -1 = 0 +mod 0 2 = 0 +mod 0 -2 = 0 +mod 0 -9223372036854775808 = 0 +mod 0 9223372036854775807 = 0 +mod 0 -9223372036854775809 = 0 +mod 0 9223372036854775808 = 0 +mod 0 18446744073709551614 = 0 +mod 0 85070591730234615847396907784232501249 = 0 +mod 1 1 = 0 +mod 1 -1 = 0 +mod 1 2 = 1 +mod 1 -2 = -1 +mod 1 -9223372036854775808 = -9223372036854775807 +mod 1 9223372036854775807 = 1 +mod 1 -9223372036854775809 = -9223372036854775808 +mod 1 9223372036854775808 = 1 +mod 1 18446744073709551614 = 1 +mod 1 85070591730234615847396907784232501249 = 1 +mod -1 1 = 0 +mod -1 -1 = 0 +mod -1 2 = 1 +mod -1 -2 = -1 +mod -1 -9223372036854775808 = -1 +mod -1 9223372036854775807 = 9223372036854775806 +mod -1 -9223372036854775809 = -1 +mod -1 9223372036854775808 = 9223372036854775807 +mod -1 18446744073709551614 = 18446744073709551613 +mod -1 85070591730234615847396907784232501249 = 85070591730234615847396907784232501248 +mod 2 1 = 0 +mod 2 -1 = 0 +mod 2 2 = 0 +mod 2 -2 = 0 +mod 2 -9223372036854775808 = -9223372036854775806 +mod 2 9223372036854775807 = 2 +mod 2 -9223372036854775809 = -9223372036854775807 +mod 2 9223372036854775808 = 2 +mod 2 18446744073709551614 = 2 +mod 2 85070591730234615847396907784232501249 = 2 +mod -2 1 = 0 +mod -2 -1 = 0 +mod -2 2 = 0 +mod -2 -2 = 0 +mod -2 -9223372036854775808 = -2 +mod -2 9223372036854775807 = 9223372036854775805 +mod -2 -9223372036854775809 = -2 +mod -2 9223372036854775808 = 9223372036854775806 +mod -2 18446744073709551614 = 18446744073709551612 +mod -2 85070591730234615847396907784232501249 = 85070591730234615847396907784232501247 +mod -9223372036854775808 1 = 0 +mod -9223372036854775808 -1 = 0 +mod -9223372036854775808 2 = 0 +mod -9223372036854775808 -2 = 0 +mod -9223372036854775808 -9223372036854775808 = 0 +mod -9223372036854775808 9223372036854775807 = 9223372036854775806 +mod -9223372036854775808 -9223372036854775809 = -9223372036854775808 +mod -9223372036854775808 9223372036854775808 = 0 +mod -9223372036854775808 18446744073709551614 = 9223372036854775806 +mod -9223372036854775808 85070591730234615847396907784232501249 = 85070591730234615838173535747377725441 +mod 9223372036854775807 1 = 0 +mod 9223372036854775807 -1 = 0 +mod 9223372036854775807 2 = 1 +mod 9223372036854775807 -2 = -1 +mod 9223372036854775807 -9223372036854775808 = -1 +mod 9223372036854775807 9223372036854775807 = 0 +mod 9223372036854775807 -9223372036854775809 = -2 +mod 9223372036854775807 9223372036854775808 = 9223372036854775807 +mod 9223372036854775807 18446744073709551614 = 9223372036854775807 +mod 9223372036854775807 85070591730234615847396907784232501249 = 9223372036854775807 +quot 0 1 = 0 +quot 0 -1 = 0 +quot 0 2 = 0 +quot 0 -2 = 0 +quot 0 -9223372036854775808 = 0 +quot 0 9223372036854775807 = 0 +quot 0 -9223372036854775809 = 0 +quot 0 9223372036854775808 = 0 +quot 0 18446744073709551614 = 0 +quot 0 85070591730234615847396907784232501249 = 0 +quot 1 1 = 1 +quot 1 -1 = -1 +quot 1 2 = 0 +quot 1 -2 = 0 +quot 1 -9223372036854775808 = 0 +quot 1 9223372036854775807 = 0 +quot 1 -9223372036854775809 = 0 +quot 1 9223372036854775808 = 0 +quot 1 18446744073709551614 = 0 +quot 1 85070591730234615847396907784232501249 = 0 +quot -1 1 = -1 +quot -1 -1 = 1 +quot -1 2 = 0 +quot -1 -2 = 0 +quot -1 -9223372036854775808 = 0 +quot -1 9223372036854775807 = 0 +quot -1 -9223372036854775809 = 0 +quot -1 9223372036854775808 = 0 +quot -1 18446744073709551614 = 0 +quot -1 85070591730234615847396907784232501249 = 0 +quot 2 1 = 2 +quot 2 -1 = -2 +quot 2 2 = 1 +quot 2 -2 = -1 +quot 2 -9223372036854775808 = 0 +quot 2 9223372036854775807 = 0 +quot 2 -9223372036854775809 = 0 +quot 2 9223372036854775808 = 0 +quot 2 18446744073709551614 = 0 +quot 2 85070591730234615847396907784232501249 = 0 +quot -2 1 = -2 +quot -2 -1 = 2 +quot -2 2 = -1 +quot -2 -2 = 1 +quot -2 -9223372036854775808 = 0 +quot -2 9223372036854775807 = 0 +quot -2 -9223372036854775809 = 0 +quot -2 9223372036854775808 = 0 +quot -2 18446744073709551614 = 0 +quot -2 85070591730234615847396907784232501249 = 0 +quot -9223372036854775808 1 = -9223372036854775808 +quot -9223372036854775808 -1 = 9223372036854775808 +quot -9223372036854775808 2 = -4611686018427387904 +quot -9223372036854775808 -2 = 4611686018427387904 +quot -9223372036854775808 -9223372036854775808 = 1 +quot -9223372036854775808 9223372036854775807 = -1 +quot -9223372036854775808 -9223372036854775809 = 0 +quot -9223372036854775808 9223372036854775808 = -1 +quot -9223372036854775808 18446744073709551614 = 0 +quot -9223372036854775808 85070591730234615847396907784232501249 = 0 +quot 9223372036854775807 1 = 9223372036854775807 +quot 9223372036854775807 -1 = -9223372036854775807 +quot 9223372036854775807 2 = 4611686018427387903 +quot 9223372036854775807 -2 = -4611686018427387903 +quot 9223372036854775807 -9223372036854775808 = 0 +quot 9223372036854775807 9223372036854775807 = 1 +quot 9223372036854775807 -9223372036854775809 = 0 +quot 9223372036854775807 9223372036854775808 = 0 +quot 9223372036854775807 18446744073709551614 = 0 +quot 9223372036854775807 85070591730234615847396907784232501249 = 0 +rem 0 1 = 0 +rem 0 -1 = 0 +rem 0 2 = 0 +rem 0 -2 = 0 +rem 0 -9223372036854775808 = 0 +rem 0 9223372036854775807 = 0 +rem 0 -9223372036854775809 = 0 +rem 0 9223372036854775808 = 0 +rem 0 18446744073709551614 = 0 +rem 0 85070591730234615847396907784232501249 = 0 +rem 1 1 = 0 +rem 1 -1 = 0 +rem 1 2 = 1 +rem 1 -2 = 1 +rem 1 -9223372036854775808 = 1 +rem 1 9223372036854775807 = 1 +rem 1 -9223372036854775809 = 1 +rem 1 9223372036854775808 = 1 +rem 1 18446744073709551614 = 1 +rem 1 85070591730234615847396907784232501249 = 1 +rem -1 1 = 0 +rem -1 -1 = 0 +rem -1 2 = -1 +rem -1 -2 = -1 +rem -1 -9223372036854775808 = -1 +rem -1 9223372036854775807 = -1 +rem -1 -9223372036854775809 = -1 +rem -1 9223372036854775808 = -1 +rem -1 18446744073709551614 = -1 +rem -1 85070591730234615847396907784232501249 = -1 +rem 2 1 = 0 +rem 2 -1 = 0 +rem 2 2 = 0 +rem 2 -2 = 0 +rem 2 -9223372036854775808 = 2 +rem 2 9223372036854775807 = 2 +rem 2 -9223372036854775809 = 2 +rem 2 9223372036854775808 = 2 +rem 2 18446744073709551614 = 2 +rem 2 85070591730234615847396907784232501249 = 2 +rem -2 1 = 0 +rem -2 -1 = 0 +rem -2 2 = 0 +rem -2 -2 = 0 +rem -2 -9223372036854775808 = -2 +rem -2 9223372036854775807 = -2 +rem -2 -9223372036854775809 = -2 +rem -2 9223372036854775808 = -2 +rem -2 18446744073709551614 = -2 +rem -2 85070591730234615847396907784232501249 = -2 +rem -9223372036854775808 1 = 0 +rem -9223372036854775808 -1 = 0 +rem -9223372036854775808 2 = 0 +rem -9223372036854775808 -2 = 0 +rem -9223372036854775808 -9223372036854775808 = 0 +rem -9223372036854775808 9223372036854775807 = -1 +rem -9223372036854775808 -9223372036854775809 = -9223372036854775808 +rem -9223372036854775808 9223372036854775808 = 0 +rem -9223372036854775808 18446744073709551614 = -9223372036854775808 +rem -9223372036854775808 85070591730234615847396907784232501249 = -9223372036854775808 +rem 9223372036854775807 1 = 0 +rem 9223372036854775807 -1 = 0 +rem 9223372036854775807 2 = 1 +rem 9223372036854775807 -2 = 1 +rem 9223372036854775807 -9223372036854775808 = 9223372036854775807 +rem 9223372036854775807 9223372036854775807 = 0 +rem 9223372036854775807 -9223372036854775809 = 9223372036854775807 +rem 9223372036854775807 9223372036854775808 = 9223372036854775807 +rem 9223372036854775807 18446744073709551614 = 9223372036854775807 +rem 9223372036854775807 85070591730234615847396907784232501249 = 9223372036854775807 +gcd 0 1 = 1 +gcd 0 -1 = 1 +gcd 0 2 = 2 +gcd 0 -2 = 2 +gcd 0 -9223372036854775808 = 9223372036854775808 +gcd 0 9223372036854775807 = 9223372036854775807 +gcd 1 0 = 1 +gcd 1 1 = 1 +gcd 1 -1 = 1 +gcd 1 2 = 1 +gcd 1 -2 = 1 +gcd 1 -9223372036854775808 = 1 +gcd 1 9223372036854775807 = 1 +gcd -1 0 = 1 +gcd -1 1 = 1 +gcd -1 -1 = 1 +gcd -1 2 = 1 +gcd -1 -2 = 1 +gcd -1 -9223372036854775808 = 1 +gcd -1 9223372036854775807 = 1 +gcd 2 0 = 2 +gcd 2 1 = 1 +gcd 2 -1 = 1 +gcd 2 2 = 2 +gcd 2 -2 = 2 +gcd 2 -9223372036854775808 = 2 +gcd 2 9223372036854775807 = 1 +gcd -2 0 = 2 +gcd -2 1 = 1 +gcd -2 -1 = 1 +gcd -2 2 = 2 +gcd -2 -2 = 2 +gcd -2 -9223372036854775808 = 2 +gcd -2 9223372036854775807 = 1 +gcd -9223372036854775808 0 = 9223372036854775808 +gcd -9223372036854775808 1 = 1 +gcd -9223372036854775808 -1 = 1 +gcd -9223372036854775808 2 = 2 +gcd -9223372036854775808 -2 = 2 +gcd -9223372036854775808 -9223372036854775808 = 9223372036854775808 +gcd -9223372036854775808 9223372036854775807 = 1 +gcd 9223372036854775807 0 = 9223372036854775807 +gcd 9223372036854775807 1 = 1 +gcd 9223372036854775807 -1 = 1 +gcd 9223372036854775807 2 = 1 +gcd 9223372036854775807 -2 = 1 +gcd 9223372036854775807 -9223372036854775808 = 1 +gcd 9223372036854775807 9223372036854775807 = 9223372036854775807 +lcm 0 1 = 0 +lcm 0 -1 = 0 +lcm 0 2 = 0 +lcm 0 -2 = 0 +lcm 0 -9223372036854775808 = 0 +lcm 0 9223372036854775807 = 0 +lcm 1 0 = 0 +lcm 1 1 = 1 +lcm 1 -1 = 1 +lcm 1 2 = 2 +lcm 1 -2 = 2 +lcm 1 -9223372036854775808 = 9223372036854775808 +lcm 1 9223372036854775807 = 9223372036854775807 +lcm -1 0 = 0 +lcm -1 1 = 1 +lcm -1 -1 = 1 +lcm -1 2 = 2 +lcm -1 -2 = 2 +lcm -1 -9223372036854775808 = 9223372036854775808 +lcm -1 9223372036854775807 = 9223372036854775807 +lcm 2 0 = 0 +lcm 2 1 = 2 +lcm 2 -1 = 2 +lcm 2 2 = 2 +lcm 2 -2 = 2 +lcm 2 -9223372036854775808 = 9223372036854775808 +lcm 2 9223372036854775807 = 18446744073709551614 +lcm -2 0 = 0 +lcm -2 1 = 2 +lcm -2 -1 = 2 +lcm -2 2 = 2 +lcm -2 -2 = 2 +lcm -2 -9223372036854775808 = 9223372036854775808 +lcm -2 9223372036854775807 = 18446744073709551614 +lcm -9223372036854775808 0 = 0 +lcm -9223372036854775808 1 = 9223372036854775808 +lcm -9223372036854775808 -1 = 9223372036854775808 +lcm -9223372036854775808 2 = 9223372036854775808 +lcm -9223372036854775808 -2 = 9223372036854775808 +lcm -9223372036854775808 -9223372036854775808 = 9223372036854775808 +lcm -9223372036854775808 9223372036854775807 = 85070591730234615856620279821087277056 +lcm 9223372036854775807 0 = 0 +lcm 9223372036854775807 1 = 9223372036854775807 +lcm 9223372036854775807 -1 = 9223372036854775807 +lcm 9223372036854775807 2 = 18446744073709551614 +lcm 9223372036854775807 -2 = 18446744073709551614 +lcm 9223372036854775807 -9223372036854775808 = 85070591730234615856620279821087277056 +lcm 9223372036854775807 9223372036854775807 = 9223372036854775807 diff --git a/testsuite/tests/numeric/should_run/arith003.stdout-ws-64 b/testsuite/tests/numeric/should_run/arith003.stdout-ws-64 new file mode 100644 index 0000000000..9d8f7eee82 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith003.stdout-ws-64 @@ -0,0 +1,1109 @@ +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -9223372036854775808 = -9223372036854775808 +(+) 0 9223372036854775807 = 9223372036854775807 +(+) 1 0 = 1 +(+) 1 1 = 2 +(+) 1 -1 = 0 +(+) 1 2 = 3 +(+) 1 -2 = -1 +(+) 1 -9223372036854775808 = -9223372036854775807 +(+) 1 9223372036854775807 = -9223372036854775808 +(+) -1 0 = -1 +(+) -1 1 = 0 +(+) -1 -1 = -2 +(+) -1 2 = 1 +(+) -1 -2 = -3 +(+) -1 -9223372036854775808 = 9223372036854775807 +(+) -1 9223372036854775807 = 9223372036854775806 +(+) 2 0 = 2 +(+) 2 1 = 3 +(+) 2 -1 = 1 +(+) 2 2 = 4 +(+) 2 -2 = 0 +(+) 2 -9223372036854775808 = -9223372036854775806 +(+) 2 9223372036854775807 = -9223372036854775807 +(+) -2 0 = -2 +(+) -2 1 = -1 +(+) -2 -1 = -3 +(+) -2 2 = 0 +(+) -2 -2 = -4 +(+) -2 -9223372036854775808 = 9223372036854775806 +(+) -2 9223372036854775807 = 9223372036854775805 +(+) -9223372036854775808 0 = -9223372036854775808 +(+) -9223372036854775808 1 = -9223372036854775807 +(+) -9223372036854775808 -1 = 9223372036854775807 +(+) -9223372036854775808 2 = -9223372036854775806 +(+) -9223372036854775808 -2 = 9223372036854775806 +(+) -9223372036854775808 -9223372036854775808 = 0 +(+) -9223372036854775808 9223372036854775807 = -1 +(+) 9223372036854775807 0 = 9223372036854775807 +(+) 9223372036854775807 1 = -9223372036854775808 +(+) 9223372036854775807 -1 = 9223372036854775806 +(+) 9223372036854775807 2 = -9223372036854775807 +(+) 9223372036854775807 -2 = 9223372036854775805 +(+) 9223372036854775807 -9223372036854775808 = -1 +(+) 9223372036854775807 9223372036854775807 = -2 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -9223372036854775808 = -9223372036854775808 +(-) 0 9223372036854775807 = -9223372036854775807 +(-) 1 0 = 1 +(-) 1 1 = 0 +(-) 1 -1 = 2 +(-) 1 2 = -1 +(-) 1 -2 = 3 +(-) 1 -9223372036854775808 = -9223372036854775807 +(-) 1 9223372036854775807 = -9223372036854775806 +(-) -1 0 = -1 +(-) -1 1 = -2 +(-) -1 -1 = 0 +(-) -1 2 = -3 +(-) -1 -2 = 1 +(-) -1 -9223372036854775808 = 9223372036854775807 +(-) -1 9223372036854775807 = -9223372036854775808 +(-) 2 0 = 2 +(-) 2 1 = 1 +(-) 2 -1 = 3 +(-) 2 2 = 0 +(-) 2 -2 = 4 +(-) 2 -9223372036854775808 = -9223372036854775806 +(-) 2 9223372036854775807 = -9223372036854775805 +(-) -2 0 = -2 +(-) -2 1 = -3 +(-) -2 -1 = -1 +(-) -2 2 = -4 +(-) -2 -2 = 0 +(-) -2 -9223372036854775808 = 9223372036854775806 +(-) -2 9223372036854775807 = 9223372036854775807 +(-) -9223372036854775808 0 = -9223372036854775808 +(-) -9223372036854775808 1 = 9223372036854775807 +(-) -9223372036854775808 -1 = -9223372036854775807 +(-) -9223372036854775808 2 = 9223372036854775806 +(-) -9223372036854775808 -2 = -9223372036854775806 +(-) -9223372036854775808 -9223372036854775808 = 0 +(-) -9223372036854775808 9223372036854775807 = 1 +(-) 9223372036854775807 0 = 9223372036854775807 +(-) 9223372036854775807 1 = 9223372036854775806 +(-) 9223372036854775807 -1 = -9223372036854775808 +(-) 9223372036854775807 2 = 9223372036854775805 +(-) 9223372036854775807 -2 = -9223372036854775807 +(-) 9223372036854775807 -9223372036854775808 = -1 +(-) 9223372036854775807 9223372036854775807 = 0 +(^) 0 0 = 1 +(^) 0 1 = 0 +(^) 0 2 = 0 +(^) 1 0 = 1 +(^) 1 1 = 1 +(^) 1 2 = 1 +(^) -1 0 = 1 +(^) -1 1 = -1 +(^) -1 2 = 1 +(^) 2 0 = 1 +(^) 2 1 = 2 +(^) 2 2 = 4 +(^) -2 0 = 1 +(^) -2 1 = -2 +(^) -2 2 = 4 +(^) -9223372036854775808 0 = 1 +(^) -9223372036854775808 1 = -9223372036854775808 +(^) -9223372036854775808 2 = 0 +(^) 9223372036854775807 0 = 1 +(^) 9223372036854775807 1 = 9223372036854775807 +(^) 9223372036854775807 2 = 1 +div 0 1 = 0 +div 0 -1 = 0 +div 0 2 = 0 +div 0 -2 = 0 +div 0 -9223372036854775808 = 0 +div 0 9223372036854775807 = 0 +div 1 1 = 1 +div 1 -1 = -1 +div 1 2 = 0 +div 1 -2 = -1 +div 1 -9223372036854775808 = -1 +div 1 9223372036854775807 = 0 +div -1 1 = -1 +div -1 -1 = 1 +div -1 2 = -1 +div -1 -2 = 0 +div -1 -9223372036854775808 = 0 +div -1 9223372036854775807 = -1 +div 2 1 = 2 +div 2 -1 = -2 +div 2 2 = 1 +div 2 -2 = -1 +div 2 -9223372036854775808 = -1 +div 2 9223372036854775807 = 0 +div -2 1 = -2 +div -2 -1 = 2 +div -2 2 = -1 +div -2 -2 = 1 +div -2 -9223372036854775808 = 0 +div -2 9223372036854775807 = -1 +div 9223372036854775807 1 = 9223372036854775807 +div 9223372036854775807 -1 = -9223372036854775807 +div 9223372036854775807 2 = 4611686018427387903 +div 9223372036854775807 -2 = -4611686018427387904 +div 9223372036854775807 -9223372036854775808 = -1 +div 9223372036854775807 9223372036854775807 = 1 +mod 0 1 = 0 +mod 0 -1 = 0 +mod 0 2 = 0 +mod 0 -2 = 0 +mod 0 -9223372036854775808 = 0 +mod 0 9223372036854775807 = 0 +mod 1 1 = 0 +mod 1 -1 = 0 +mod 1 2 = 1 +mod 1 -2 = -1 +mod 1 -9223372036854775808 = -9223372036854775807 +mod 1 9223372036854775807 = 1 +mod -1 1 = 0 +mod -1 -1 = 0 +mod -1 2 = 1 +mod -1 -2 = -1 +mod -1 -9223372036854775808 = -1 +mod -1 9223372036854775807 = 9223372036854775806 +mod 2 1 = 0 +mod 2 -1 = 0 +mod 2 2 = 0 +mod 2 -2 = 0 +mod 2 -9223372036854775808 = -9223372036854775806 +mod 2 9223372036854775807 = 2 +mod -2 1 = 0 +mod -2 -1 = 0 +mod -2 2 = 0 +mod -2 -2 = 0 +mod -2 -9223372036854775808 = -2 +mod -2 9223372036854775807 = 9223372036854775805 +mod 9223372036854775807 1 = 0 +mod 9223372036854775807 -1 = 0 +mod 9223372036854775807 2 = 1 +mod 9223372036854775807 -2 = -1 +mod 9223372036854775807 -9223372036854775808 = -1 +mod 9223372036854775807 9223372036854775807 = 0 +quot 0 1 = 0 +quot 0 -1 = 0 +quot 0 2 = 0 +quot 0 -2 = 0 +quot 0 -9223372036854775808 = 0 +quot 0 9223372036854775807 = 0 +quot 1 1 = 1 +quot 1 -1 = -1 +quot 1 2 = 0 +quot 1 -2 = 0 +quot 1 -9223372036854775808 = 0 +quot 1 9223372036854775807 = 0 +quot -1 1 = -1 +quot -1 -1 = 1 +quot -1 2 = 0 +quot -1 -2 = 0 +quot -1 -9223372036854775808 = 0 +quot -1 9223372036854775807 = 0 +quot 2 1 = 2 +quot 2 -1 = -2 +quot 2 2 = 1 +quot 2 -2 = -1 +quot 2 -9223372036854775808 = 0 +quot 2 9223372036854775807 = 0 +quot -2 1 = -2 +quot -2 -1 = 2 +quot -2 2 = -1 +quot -2 -2 = 1 +quot -2 -9223372036854775808 = 0 +quot -2 9223372036854775807 = 0 +quot 9223372036854775807 1 = 9223372036854775807 +quot 9223372036854775807 -1 = -9223372036854775807 +quot 9223372036854775807 2 = 4611686018427387903 +quot 9223372036854775807 -2 = -4611686018427387903 +quot 9223372036854775807 -9223372036854775808 = 0 +quot 9223372036854775807 9223372036854775807 = 1 +rem 0 1 = 0 +rem 0 -1 = 0 +rem 0 2 = 0 +rem 0 -2 = 0 +rem 0 -9223372036854775808 = 0 +rem 0 9223372036854775807 = 0 +rem 1 1 = 0 +rem 1 -1 = 0 +rem 1 2 = 1 +rem 1 -2 = 1 +rem 1 -9223372036854775808 = 1 +rem 1 9223372036854775807 = 1 +rem -1 1 = 0 +rem -1 -1 = 0 +rem -1 2 = -1 +rem -1 -2 = -1 +rem -1 -9223372036854775808 = -1 +rem -1 9223372036854775807 = -1 +rem 2 1 = 0 +rem 2 -1 = 0 +rem 2 2 = 0 +rem 2 -2 = 0 +rem 2 -9223372036854775808 = 2 +rem 2 9223372036854775807 = 2 +rem -2 1 = 0 +rem -2 -1 = 0 +rem -2 2 = 0 +rem -2 -2 = 0 +rem -2 -9223372036854775808 = -2 +rem -2 9223372036854775807 = -2 +rem 9223372036854775807 1 = 0 +rem 9223372036854775807 -1 = 0 +rem 9223372036854775807 2 = 1 +rem 9223372036854775807 -2 = 1 +rem 9223372036854775807 -9223372036854775808 = 9223372036854775807 +rem 9223372036854775807 9223372036854775807 = 0 +gcd 0 1 = 1 +gcd 0 -1 = 1 +gcd 0 2 = 2 +gcd 0 -2 = 2 +gcd 0 9223372036854775807 = 9223372036854775807 +gcd 1 0 = 1 +gcd 1 1 = 1 +gcd 1 -1 = 1 +gcd 1 2 = 1 +gcd 1 -2 = 1 +gcd 1 9223372036854775807 = 1 +gcd -1 0 = 1 +gcd -1 1 = 1 +gcd -1 -1 = 1 +gcd -1 2 = 1 +gcd -1 -2 = 1 +gcd -1 9223372036854775807 = 1 +gcd 2 0 = 2 +gcd 2 1 = 1 +gcd 2 -1 = 1 +gcd 2 2 = 2 +gcd 2 -2 = 2 +gcd 2 9223372036854775807 = 1 +gcd -2 0 = 2 +gcd -2 1 = 1 +gcd -2 -1 = 1 +gcd -2 2 = 2 +gcd -2 -2 = 2 +gcd -2 9223372036854775807 = 1 +gcd 9223372036854775807 0 = 9223372036854775807 +gcd 9223372036854775807 1 = 1 +gcd 9223372036854775807 -1 = 1 +gcd 9223372036854775807 2 = 1 +gcd 9223372036854775807 -2 = 1 +gcd 9223372036854775807 9223372036854775807 = 9223372036854775807 +lcm 0 1 = 0 +lcm 0 -1 = 0 +lcm 0 2 = 0 +lcm 0 -2 = 0 +lcm 0 -9223372036854775808 = 0 +lcm 1 0 = 0 +lcm 1 1 = 1 +lcm 1 -1 = 1 +lcm 1 2 = 2 +lcm 1 -2 = 2 +lcm 1 -9223372036854775808 = -9223372036854775808 +lcm -1 0 = 0 +lcm -1 1 = 1 +lcm -1 -1 = 1 +lcm -1 2 = 2 +lcm -1 -2 = 2 +lcm -1 -9223372036854775808 = -9223372036854775808 +lcm 2 0 = 0 +lcm 2 1 = 2 +lcm 2 -1 = 2 +lcm 2 2 = 2 +lcm 2 -2 = 2 +lcm 2 -9223372036854775808 = -9223372036854775808 +lcm -2 0 = 0 +lcm -2 1 = 2 +lcm -2 -1 = 2 +lcm -2 2 = 2 +lcm -2 -2 = 2 +lcm -2 -9223372036854775808 = -9223372036854775808 +lcm -9223372036854775808 0 = 0 +lcm -9223372036854775808 1 = -9223372036854775808 +lcm -9223372036854775808 -1 = -9223372036854775808 +lcm -9223372036854775808 2 = -9223372036854775808 +lcm -9223372036854775808 -2 = -9223372036854775808 +lcm -9223372036854775808 -9223372036854775808 = -9223372036854775808 +lcm 9223372036854775807 0 = 0 +lcm 9223372036854775807 1 = 9223372036854775807 +lcm 9223372036854775807 -1 = 9223372036854775807 +lcm 9223372036854775807 2 = 2 +lcm 9223372036854775807 -2 = 2 +lcm 9223372036854775807 -9223372036854775808 = -9223372036854775808 +(+) 0 0 = 0 +(+) 0 1 = 1 +(+) 0 -1 = -1 +(+) 0 2 = 2 +(+) 0 -2 = -2 +(+) 0 -9223372036854775808 = -9223372036854775808 +(+) 0 9223372036854775807 = 9223372036854775807 +(+) 0 -9223372036854775809 = -9223372036854775809 +(+) 0 9223372036854775808 = 9223372036854775808 +(+) 0 -18446744073709551616 = -18446744073709551616 +(+) 0 18446744073709551614 = 18446744073709551614 +(+) 0 85070591730234615865843651857942052864 = 85070591730234615865843651857942052864 +(+) 0 85070591730234615847396907784232501249 = 85070591730234615847396907784232501249 +(+) 1 0 = 1 +(+) 1 1 = 2 +(+) 1 -1 = 0 +(+) 1 2 = 3 +(+) 1 -2 = -1 +(+) 1 -9223372036854775808 = -9223372036854775807 +(+) 1 9223372036854775807 = 9223372036854775808 +(+) 1 -9223372036854775809 = -9223372036854775808 +(+) 1 9223372036854775808 = 9223372036854775809 +(+) 1 -18446744073709551616 = -18446744073709551615 +(+) 1 18446744073709551614 = 18446744073709551615 +(+) 1 85070591730234615865843651857942052864 = 85070591730234615865843651857942052865 +(+) 1 85070591730234615847396907784232501249 = 85070591730234615847396907784232501250 +(+) -1 0 = -1 +(+) -1 1 = 0 +(+) -1 -1 = -2 +(+) -1 2 = 1 +(+) -1 -2 = -3 +(+) -1 -9223372036854775808 = -9223372036854775809 +(+) -1 9223372036854775807 = 9223372036854775806 +(+) -1 -9223372036854775809 = -9223372036854775810 +(+) -1 9223372036854775808 = 9223372036854775807 +(+) -1 -18446744073709551616 = -18446744073709551617 +(+) -1 18446744073709551614 = 18446744073709551613 +(+) -1 85070591730234615865843651857942052864 = 85070591730234615865843651857942052863 +(+) -1 85070591730234615847396907784232501249 = 85070591730234615847396907784232501248 +(+) 2 0 = 2 +(+) 2 1 = 3 +(+) 2 -1 = 1 +(+) 2 2 = 4 +(+) 2 -2 = 0 +(+) 2 -9223372036854775808 = -9223372036854775806 +(+) 2 9223372036854775807 = 9223372036854775809 +(+) 2 -9223372036854775809 = -9223372036854775807 +(+) 2 9223372036854775808 = 9223372036854775810 +(+) 2 -18446744073709551616 = -18446744073709551614 +(+) 2 18446744073709551614 = 18446744073709551616 +(+) 2 85070591730234615865843651857942052864 = 85070591730234615865843651857942052866 +(+) 2 85070591730234615847396907784232501249 = 85070591730234615847396907784232501251 +(+) -2 0 = -2 +(+) -2 1 = -1 +(+) -2 -1 = -3 +(+) -2 2 = 0 +(+) -2 -2 = -4 +(+) -2 -9223372036854775808 = -9223372036854775810 +(+) -2 9223372036854775807 = 9223372036854775805 +(+) -2 -9223372036854775809 = -9223372036854775811 +(+) -2 9223372036854775808 = 9223372036854775806 +(+) -2 -18446744073709551616 = -18446744073709551618 +(+) -2 18446744073709551614 = 18446744073709551612 +(+) -2 85070591730234615865843651857942052864 = 85070591730234615865843651857942052862 +(+) -2 85070591730234615847396907784232501249 = 85070591730234615847396907784232501247 +(+) -9223372036854775808 0 = -9223372036854775808 +(+) -9223372036854775808 1 = -9223372036854775807 +(+) -9223372036854775808 -1 = -9223372036854775809 +(+) -9223372036854775808 2 = -9223372036854775806 +(+) -9223372036854775808 -2 = -9223372036854775810 +(+) -9223372036854775808 -9223372036854775808 = -18446744073709551616 +(+) -9223372036854775808 9223372036854775807 = -1 +(+) -9223372036854775808 -9223372036854775809 = -18446744073709551617 +(+) -9223372036854775808 9223372036854775808 = 0 +(+) -9223372036854775808 -18446744073709551616 = -27670116110564327424 +(+) -9223372036854775808 18446744073709551614 = 9223372036854775806 +(+) -9223372036854775808 85070591730234615865843651857942052864 = 85070591730234615856620279821087277056 +(+) -9223372036854775808 85070591730234615847396907784232501249 = 85070591730234615838173535747377725441 +(+) 9223372036854775807 0 = 9223372036854775807 +(+) 9223372036854775807 1 = 9223372036854775808 +(+) 9223372036854775807 -1 = 9223372036854775806 +(+) 9223372036854775807 2 = 9223372036854775809 +(+) 9223372036854775807 -2 = 9223372036854775805 +(+) 9223372036854775807 -9223372036854775808 = -1 +(+) 9223372036854775807 9223372036854775807 = 18446744073709551614 +(+) 9223372036854775807 -9223372036854775809 = -2 +(+) 9223372036854775807 9223372036854775808 = 18446744073709551615 +(+) 9223372036854775807 -18446744073709551616 = -9223372036854775809 +(+) 9223372036854775807 18446744073709551614 = 27670116110564327421 +(+) 9223372036854775807 85070591730234615865843651857942052864 = 85070591730234615875067023894796828671 +(+) 9223372036854775807 85070591730234615847396907784232501249 = 85070591730234615856620279821087277056 +(+) -9223372036854775809 0 = -9223372036854775809 +(+) -9223372036854775809 1 = -9223372036854775808 +(+) -9223372036854775809 -1 = -9223372036854775810 +(+) -9223372036854775809 2 = -9223372036854775807 +(+) -9223372036854775809 -2 = -9223372036854775811 +(+) -9223372036854775809 -9223372036854775808 = -18446744073709551617 +(+) -9223372036854775809 9223372036854775807 = -2 +(+) -9223372036854775809 -9223372036854775809 = -18446744073709551618 +(+) -9223372036854775809 9223372036854775808 = -1 +(+) -9223372036854775809 -18446744073709551616 = -27670116110564327425 +(+) -9223372036854775809 18446744073709551614 = 9223372036854775805 +(+) -9223372036854775809 85070591730234615865843651857942052864 = 85070591730234615856620279821087277055 +(+) -9223372036854775809 85070591730234615847396907784232501249 = 85070591730234615838173535747377725440 +(+) 9223372036854775808 0 = 9223372036854775808 +(+) 9223372036854775808 1 = 9223372036854775809 +(+) 9223372036854775808 -1 = 9223372036854775807 +(+) 9223372036854775808 2 = 9223372036854775810 +(+) 9223372036854775808 -2 = 9223372036854775806 +(+) 9223372036854775808 -9223372036854775808 = 0 +(+) 9223372036854775808 9223372036854775807 = 18446744073709551615 +(+) 9223372036854775808 -9223372036854775809 = -1 +(+) 9223372036854775808 9223372036854775808 = 18446744073709551616 +(+) 9223372036854775808 -18446744073709551616 = -9223372036854775808 +(+) 9223372036854775808 18446744073709551614 = 27670116110564327422 +(+) 9223372036854775808 85070591730234615865843651857942052864 = 85070591730234615875067023894796828672 +(+) 9223372036854775808 85070591730234615847396907784232501249 = 85070591730234615856620279821087277057 +(+) -18446744073709551616 0 = -18446744073709551616 +(+) -18446744073709551616 1 = -18446744073709551615 +(+) -18446744073709551616 -1 = -18446744073709551617 +(+) -18446744073709551616 2 = -18446744073709551614 +(+) -18446744073709551616 -2 = -18446744073709551618 +(+) -18446744073709551616 -9223372036854775808 = -27670116110564327424 +(+) -18446744073709551616 9223372036854775807 = -9223372036854775809 +(+) -18446744073709551616 -9223372036854775809 = -27670116110564327425 +(+) -18446744073709551616 9223372036854775808 = -9223372036854775808 +(+) -18446744073709551616 -18446744073709551616 = -36893488147419103232 +(+) -18446744073709551616 18446744073709551614 = -2 +(+) -18446744073709551616 85070591730234615865843651857942052864 = 85070591730234615847396907784232501248 +(+) -18446744073709551616 85070591730234615847396907784232501249 = 85070591730234615828950163710522949633 +(+) 18446744073709551614 0 = 18446744073709551614 +(+) 18446744073709551614 1 = 18446744073709551615 +(+) 18446744073709551614 -1 = 18446744073709551613 +(+) 18446744073709551614 2 = 18446744073709551616 +(+) 18446744073709551614 -2 = 18446744073709551612 +(+) 18446744073709551614 -9223372036854775808 = 9223372036854775806 +(+) 18446744073709551614 9223372036854775807 = 27670116110564327421 +(+) 18446744073709551614 -9223372036854775809 = 9223372036854775805 +(+) 18446744073709551614 9223372036854775808 = 27670116110564327422 +(+) 18446744073709551614 -18446744073709551616 = -2 +(+) 18446744073709551614 18446744073709551614 = 36893488147419103228 +(+) 18446744073709551614 85070591730234615865843651857942052864 = 85070591730234615884290395931651604478 +(+) 18446744073709551614 85070591730234615847396907784232501249 = 85070591730234615865843651857942052863 +(+) 85070591730234615865843651857942052864 0 = 85070591730234615865843651857942052864 +(+) 85070591730234615865843651857942052864 1 = 85070591730234615865843651857942052865 +(+) 85070591730234615865843651857942052864 -1 = 85070591730234615865843651857942052863 +(+) 85070591730234615865843651857942052864 2 = 85070591730234615865843651857942052866 +(+) 85070591730234615865843651857942052864 -2 = 85070591730234615865843651857942052862 +(+) 85070591730234615865843651857942052864 -9223372036854775808 = 85070591730234615856620279821087277056 +(+) 85070591730234615865843651857942052864 9223372036854775807 = 85070591730234615875067023894796828671 +(+) 85070591730234615865843651857942052864 -9223372036854775809 = 85070591730234615856620279821087277055 +(+) 85070591730234615865843651857942052864 9223372036854775808 = 85070591730234615875067023894796828672 +(+) 85070591730234615865843651857942052864 -18446744073709551616 = 85070591730234615847396907784232501248 +(+) 85070591730234615865843651857942052864 18446744073709551614 = 85070591730234615884290395931651604478 +(+) 85070591730234615865843651857942052864 85070591730234615865843651857942052864 = 170141183460469231731687303715884105728 +(+) 85070591730234615865843651857942052864 85070591730234615847396907784232501249 = 170141183460469231713240559642174554113 +(+) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(+) 85070591730234615847396907784232501249 1 = 85070591730234615847396907784232501250 +(+) 85070591730234615847396907784232501249 -1 = 85070591730234615847396907784232501248 +(+) 85070591730234615847396907784232501249 2 = 85070591730234615847396907784232501251 +(+) 85070591730234615847396907784232501249 -2 = 85070591730234615847396907784232501247 +(+) 85070591730234615847396907784232501249 -9223372036854775808 = 85070591730234615838173535747377725441 +(+) 85070591730234615847396907784232501249 9223372036854775807 = 85070591730234615856620279821087277056 +(+) 85070591730234615847396907784232501249 -9223372036854775809 = 85070591730234615838173535747377725440 +(+) 85070591730234615847396907784232501249 9223372036854775808 = 85070591730234615856620279821087277057 +(+) 85070591730234615847396907784232501249 -18446744073709551616 = 85070591730234615828950163710522949633 +(+) 85070591730234615847396907784232501249 18446744073709551614 = 85070591730234615865843651857942052863 +(+) 85070591730234615847396907784232501249 85070591730234615865843651857942052864 = 170141183460469231713240559642174554113 +(+) 85070591730234615847396907784232501249 85070591730234615847396907784232501249 = 170141183460469231694793815568465002498 +(-) 0 0 = 0 +(-) 0 1 = -1 +(-) 0 -1 = 1 +(-) 0 2 = -2 +(-) 0 -2 = 2 +(-) 0 -9223372036854775808 = 9223372036854775808 +(-) 0 9223372036854775807 = -9223372036854775807 +(-) 0 -9223372036854775809 = 9223372036854775809 +(-) 0 9223372036854775808 = -9223372036854775808 +(-) 0 -18446744073709551616 = 18446744073709551616 +(-) 0 18446744073709551614 = -18446744073709551614 +(-) 0 85070591730234615865843651857942052864 = -85070591730234615865843651857942052864 +(-) 0 85070591730234615847396907784232501249 = -85070591730234615847396907784232501249 +(-) 1 0 = 1 +(-) 1 1 = 0 +(-) 1 -1 = 2 +(-) 1 2 = -1 +(-) 1 -2 = 3 +(-) 1 -9223372036854775808 = 9223372036854775809 +(-) 1 9223372036854775807 = -9223372036854775806 +(-) 1 -9223372036854775809 = 9223372036854775810 +(-) 1 9223372036854775808 = -9223372036854775807 +(-) 1 -18446744073709551616 = 18446744073709551617 +(-) 1 18446744073709551614 = -18446744073709551613 +(-) 1 85070591730234615865843651857942052864 = -85070591730234615865843651857942052863 +(-) 1 85070591730234615847396907784232501249 = -85070591730234615847396907784232501248 +(-) -1 0 = -1 +(-) -1 1 = -2 +(-) -1 -1 = 0 +(-) -1 2 = -3 +(-) -1 -2 = 1 +(-) -1 -9223372036854775808 = 9223372036854775807 +(-) -1 9223372036854775807 = -9223372036854775808 +(-) -1 -9223372036854775809 = 9223372036854775808 +(-) -1 9223372036854775808 = -9223372036854775809 +(-) -1 -18446744073709551616 = 18446744073709551615 +(-) -1 18446744073709551614 = -18446744073709551615 +(-) -1 85070591730234615865843651857942052864 = -85070591730234615865843651857942052865 +(-) -1 85070591730234615847396907784232501249 = -85070591730234615847396907784232501250 +(-) 2 0 = 2 +(-) 2 1 = 1 +(-) 2 -1 = 3 +(-) 2 2 = 0 +(-) 2 -2 = 4 +(-) 2 -9223372036854775808 = 9223372036854775810 +(-) 2 9223372036854775807 = -9223372036854775805 +(-) 2 -9223372036854775809 = 9223372036854775811 +(-) 2 9223372036854775808 = -9223372036854775806 +(-) 2 -18446744073709551616 = 18446744073709551618 +(-) 2 18446744073709551614 = -18446744073709551612 +(-) 2 85070591730234615865843651857942052864 = -85070591730234615865843651857942052862 +(-) 2 85070591730234615847396907784232501249 = -85070591730234615847396907784232501247 +(-) -2 0 = -2 +(-) -2 1 = -3 +(-) -2 -1 = -1 +(-) -2 2 = -4 +(-) -2 -2 = 0 +(-) -2 -9223372036854775808 = 9223372036854775806 +(-) -2 9223372036854775807 = -9223372036854775809 +(-) -2 -9223372036854775809 = 9223372036854775807 +(-) -2 9223372036854775808 = -9223372036854775810 +(-) -2 -18446744073709551616 = 18446744073709551614 +(-) -2 18446744073709551614 = -18446744073709551616 +(-) -2 85070591730234615865843651857942052864 = -85070591730234615865843651857942052866 +(-) -2 85070591730234615847396907784232501249 = -85070591730234615847396907784232501251 +(-) -9223372036854775808 0 = -9223372036854775808 +(-) -9223372036854775808 1 = -9223372036854775809 +(-) -9223372036854775808 -1 = -9223372036854775807 +(-) -9223372036854775808 2 = -9223372036854775810 +(-) -9223372036854775808 -2 = -9223372036854775806 +(-) -9223372036854775808 -9223372036854775808 = 0 +(-) -9223372036854775808 9223372036854775807 = -18446744073709551615 +(-) -9223372036854775808 -9223372036854775809 = 1 +(-) -9223372036854775808 9223372036854775808 = -18446744073709551616 +(-) -9223372036854775808 -18446744073709551616 = 9223372036854775808 +(-) -9223372036854775808 18446744073709551614 = -27670116110564327422 +(-) -9223372036854775808 85070591730234615865843651857942052864 = -85070591730234615875067023894796828672 +(-) -9223372036854775808 85070591730234615847396907784232501249 = -85070591730234615856620279821087277057 +(-) 9223372036854775807 0 = 9223372036854775807 +(-) 9223372036854775807 1 = 9223372036854775806 +(-) 9223372036854775807 -1 = 9223372036854775808 +(-) 9223372036854775807 2 = 9223372036854775805 +(-) 9223372036854775807 -2 = 9223372036854775809 +(-) 9223372036854775807 -9223372036854775808 = 18446744073709551615 +(-) 9223372036854775807 9223372036854775807 = 0 +(-) 9223372036854775807 -9223372036854775809 = 18446744073709551616 +(-) 9223372036854775807 9223372036854775808 = -1 +(-) 9223372036854775807 -18446744073709551616 = 27670116110564327423 +(-) 9223372036854775807 18446744073709551614 = -9223372036854775807 +(-) 9223372036854775807 85070591730234615865843651857942052864 = -85070591730234615856620279821087277057 +(-) 9223372036854775807 85070591730234615847396907784232501249 = -85070591730234615838173535747377725442 +(-) -9223372036854775809 0 = -9223372036854775809 +(-) -9223372036854775809 1 = -9223372036854775810 +(-) -9223372036854775809 -1 = -9223372036854775808 +(-) -9223372036854775809 2 = -9223372036854775811 +(-) -9223372036854775809 -2 = -9223372036854775807 +(-) -9223372036854775809 -9223372036854775808 = -1 +(-) -9223372036854775809 9223372036854775807 = -18446744073709551616 +(-) -9223372036854775809 -9223372036854775809 = 0 +(-) -9223372036854775809 9223372036854775808 = -18446744073709551617 +(-) -9223372036854775809 -18446744073709551616 = 9223372036854775807 +(-) -9223372036854775809 18446744073709551614 = -27670116110564327423 +(-) -9223372036854775809 85070591730234615865843651857942052864 = -85070591730234615875067023894796828673 +(-) -9223372036854775809 85070591730234615847396907784232501249 = -85070591730234615856620279821087277058 +(-) 9223372036854775808 0 = 9223372036854775808 +(-) 9223372036854775808 1 = 9223372036854775807 +(-) 9223372036854775808 -1 = 9223372036854775809 +(-) 9223372036854775808 2 = 9223372036854775806 +(-) 9223372036854775808 -2 = 9223372036854775810 +(-) 9223372036854775808 -9223372036854775808 = 18446744073709551616 +(-) 9223372036854775808 9223372036854775807 = 1 +(-) 9223372036854775808 -9223372036854775809 = 18446744073709551617 +(-) 9223372036854775808 9223372036854775808 = 0 +(-) 9223372036854775808 -18446744073709551616 = 27670116110564327424 +(-) 9223372036854775808 18446744073709551614 = -9223372036854775806 +(-) 9223372036854775808 85070591730234615865843651857942052864 = -85070591730234615856620279821087277056 +(-) 9223372036854775808 85070591730234615847396907784232501249 = -85070591730234615838173535747377725441 +(-) -18446744073709551616 0 = -18446744073709551616 +(-) -18446744073709551616 1 = -18446744073709551617 +(-) -18446744073709551616 -1 = -18446744073709551615 +(-) -18446744073709551616 2 = -18446744073709551618 +(-) -18446744073709551616 -2 = -18446744073709551614 +(-) -18446744073709551616 -9223372036854775808 = -9223372036854775808 +(-) -18446744073709551616 9223372036854775807 = -27670116110564327423 +(-) -18446744073709551616 -9223372036854775809 = -9223372036854775807 +(-) -18446744073709551616 9223372036854775808 = -27670116110564327424 +(-) -18446744073709551616 -18446744073709551616 = 0 +(-) -18446744073709551616 18446744073709551614 = -36893488147419103230 +(-) -18446744073709551616 85070591730234615865843651857942052864 = -85070591730234615884290395931651604480 +(-) -18446744073709551616 85070591730234615847396907784232501249 = -85070591730234615865843651857942052865 +(-) 18446744073709551614 0 = 18446744073709551614 +(-) 18446744073709551614 1 = 18446744073709551613 +(-) 18446744073709551614 -1 = 18446744073709551615 +(-) 18446744073709551614 2 = 18446744073709551612 +(-) 18446744073709551614 -2 = 18446744073709551616 +(-) 18446744073709551614 -9223372036854775808 = 27670116110564327422 +(-) 18446744073709551614 9223372036854775807 = 9223372036854775807 +(-) 18446744073709551614 -9223372036854775809 = 27670116110564327423 +(-) 18446744073709551614 9223372036854775808 = 9223372036854775806 +(-) 18446744073709551614 -18446744073709551616 = 36893488147419103230 +(-) 18446744073709551614 18446744073709551614 = 0 +(-) 18446744073709551614 85070591730234615865843651857942052864 = -85070591730234615847396907784232501250 +(-) 18446744073709551614 85070591730234615847396907784232501249 = -85070591730234615828950163710522949635 +(-) 85070591730234615865843651857942052864 0 = 85070591730234615865843651857942052864 +(-) 85070591730234615865843651857942052864 1 = 85070591730234615865843651857942052863 +(-) 85070591730234615865843651857942052864 -1 = 85070591730234615865843651857942052865 +(-) 85070591730234615865843651857942052864 2 = 85070591730234615865843651857942052862 +(-) 85070591730234615865843651857942052864 -2 = 85070591730234615865843651857942052866 +(-) 85070591730234615865843651857942052864 -9223372036854775808 = 85070591730234615875067023894796828672 +(-) 85070591730234615865843651857942052864 9223372036854775807 = 85070591730234615856620279821087277057 +(-) 85070591730234615865843651857942052864 -9223372036854775809 = 85070591730234615875067023894796828673 +(-) 85070591730234615865843651857942052864 9223372036854775808 = 85070591730234615856620279821087277056 +(-) 85070591730234615865843651857942052864 -18446744073709551616 = 85070591730234615884290395931651604480 +(-) 85070591730234615865843651857942052864 18446744073709551614 = 85070591730234615847396907784232501250 +(-) 85070591730234615865843651857942052864 85070591730234615865843651857942052864 = 0 +(-) 85070591730234615865843651857942052864 85070591730234615847396907784232501249 = 18446744073709551615 +(-) 85070591730234615847396907784232501249 0 = 85070591730234615847396907784232501249 +(-) 85070591730234615847396907784232501249 1 = 85070591730234615847396907784232501248 +(-) 85070591730234615847396907784232501249 -1 = 85070591730234615847396907784232501250 +(-) 85070591730234615847396907784232501249 2 = 85070591730234615847396907784232501247 +(-) 85070591730234615847396907784232501249 -2 = 85070591730234615847396907784232501251 +(-) 85070591730234615847396907784232501249 -9223372036854775808 = 85070591730234615856620279821087277057 +(-) 85070591730234615847396907784232501249 9223372036854775807 = 85070591730234615838173535747377725442 +(-) 85070591730234615847396907784232501249 -9223372036854775809 = 85070591730234615856620279821087277058 +(-) 85070591730234615847396907784232501249 9223372036854775808 = 85070591730234615838173535747377725441 +(-) 85070591730234615847396907784232501249 -18446744073709551616 = 85070591730234615865843651857942052865 +(-) 85070591730234615847396907784232501249 18446744073709551614 = 85070591730234615828950163710522949635 +(-) 85070591730234615847396907784232501249 85070591730234615865843651857942052864 = -18446744073709551615 +(-) 85070591730234615847396907784232501249 85070591730234615847396907784232501249 = 0 +div 0 1 = 0 +div 0 -1 = 0 +div 0 2 = 0 +div 0 -2 = 0 +div 0 -9223372036854775808 = 0 +div 0 9223372036854775807 = 0 +div 0 -9223372036854775809 = 0 +div 0 9223372036854775808 = 0 +div 0 -18446744073709551616 = 0 +div 0 18446744073709551614 = 0 +div 0 85070591730234615865843651857942052864 = 0 +div 0 85070591730234615847396907784232501249 = 0 +div 1 1 = 1 +div 1 -1 = -1 +div 1 2 = 0 +div 1 -2 = -1 +div 1 -9223372036854775808 = -1 +div 1 9223372036854775807 = 0 +div 1 -9223372036854775809 = -1 +div 1 9223372036854775808 = 0 +div 1 -18446744073709551616 = -1 +div 1 18446744073709551614 = 0 +div 1 85070591730234615865843651857942052864 = 0 +div 1 85070591730234615847396907784232501249 = 0 +div -1 1 = -1 +div -1 -1 = 1 +div -1 2 = -1 +div -1 -2 = 0 +div -1 -9223372036854775808 = 0 +div -1 9223372036854775807 = -1 +div -1 -9223372036854775809 = 0 +div -1 9223372036854775808 = -1 +div -1 -18446744073709551616 = 0 +div -1 18446744073709551614 = -1 +div -1 85070591730234615865843651857942052864 = -1 +div -1 85070591730234615847396907784232501249 = -1 +div 2 1 = 2 +div 2 -1 = -2 +div 2 2 = 1 +div 2 -2 = -1 +div 2 -9223372036854775808 = -1 +div 2 9223372036854775807 = 0 +div 2 -9223372036854775809 = -1 +div 2 9223372036854775808 = 0 +div 2 -18446744073709551616 = -1 +div 2 18446744073709551614 = 0 +div 2 85070591730234615865843651857942052864 = 0 +div 2 85070591730234615847396907784232501249 = 0 +div -2 1 = -2 +div -2 -1 = 2 +div -2 2 = -1 +div -2 -2 = 1 +div -2 -9223372036854775808 = 0 +div -2 9223372036854775807 = -1 +div -2 -9223372036854775809 = 0 +div -2 9223372036854775808 = -1 +div -2 -18446744073709551616 = 0 +div -2 18446744073709551614 = -1 +div -2 85070591730234615865843651857942052864 = -1 +div -2 85070591730234615847396907784232501249 = -1 +div -9223372036854775808 1 = -9223372036854775808 +div -9223372036854775808 -1 = 9223372036854775808 +div -9223372036854775808 2 = -4611686018427387904 +div -9223372036854775808 -2 = 4611686018427387904 +div -9223372036854775808 -9223372036854775808 = 1 +div -9223372036854775808 9223372036854775807 = -2 +div -9223372036854775808 -9223372036854775809 = 0 +div -9223372036854775808 9223372036854775808 = -1 +div -9223372036854775808 -18446744073709551616 = 0 +div -9223372036854775808 18446744073709551614 = -1 +div -9223372036854775808 85070591730234615865843651857942052864 = -1 +div -9223372036854775808 85070591730234615847396907784232501249 = -1 +div 9223372036854775807 1 = 9223372036854775807 +div 9223372036854775807 -1 = -9223372036854775807 +div 9223372036854775807 2 = 4611686018427387903 +div 9223372036854775807 -2 = -4611686018427387904 +div 9223372036854775807 -9223372036854775808 = -1 +div 9223372036854775807 9223372036854775807 = 1 +div 9223372036854775807 -9223372036854775809 = -1 +div 9223372036854775807 9223372036854775808 = 0 +div 9223372036854775807 -18446744073709551616 = -1 +div 9223372036854775807 18446744073709551614 = 0 +div 9223372036854775807 85070591730234615865843651857942052864 = 0 +div 9223372036854775807 85070591730234615847396907784232501249 = 0 +mod 0 1 = 0 +mod 0 -1 = 0 +mod 0 2 = 0 +mod 0 -2 = 0 +mod 0 -9223372036854775808 = 0 +mod 0 9223372036854775807 = 0 +mod 0 -9223372036854775809 = 0 +mod 0 9223372036854775808 = 0 +mod 0 -18446744073709551616 = 0 +mod 0 18446744073709551614 = 0 +mod 0 85070591730234615865843651857942052864 = 0 +mod 0 85070591730234615847396907784232501249 = 0 +mod 1 1 = 0 +mod 1 -1 = 0 +mod 1 2 = 1 +mod 1 -2 = -1 +mod 1 -9223372036854775808 = -9223372036854775807 +mod 1 9223372036854775807 = 1 +mod 1 -9223372036854775809 = -9223372036854775808 +mod 1 9223372036854775808 = 1 +mod 1 -18446744073709551616 = -18446744073709551615 +mod 1 18446744073709551614 = 1 +mod 1 85070591730234615865843651857942052864 = 1 +mod 1 85070591730234615847396907784232501249 = 1 +mod -1 1 = 0 +mod -1 -1 = 0 +mod -1 2 = 1 +mod -1 -2 = -1 +mod -1 -9223372036854775808 = -1 +mod -1 9223372036854775807 = 9223372036854775806 +mod -1 -9223372036854775809 = -1 +mod -1 9223372036854775808 = 9223372036854775807 +mod -1 -18446744073709551616 = -1 +mod -1 18446744073709551614 = 18446744073709551613 +mod -1 85070591730234615865843651857942052864 = 85070591730234615865843651857942052863 +mod -1 85070591730234615847396907784232501249 = 85070591730234615847396907784232501248 +mod 2 1 = 0 +mod 2 -1 = 0 +mod 2 2 = 0 +mod 2 -2 = 0 +mod 2 -9223372036854775808 = -9223372036854775806 +mod 2 9223372036854775807 = 2 +mod 2 -9223372036854775809 = -9223372036854775807 +mod 2 9223372036854775808 = 2 +mod 2 -18446744073709551616 = -18446744073709551614 +mod 2 18446744073709551614 = 2 +mod 2 85070591730234615865843651857942052864 = 2 +mod 2 85070591730234615847396907784232501249 = 2 +mod -2 1 = 0 +mod -2 -1 = 0 +mod -2 2 = 0 +mod -2 -2 = 0 +mod -2 -9223372036854775808 = -2 +mod -2 9223372036854775807 = 9223372036854775805 +mod -2 -9223372036854775809 = -2 +mod -2 9223372036854775808 = 9223372036854775806 +mod -2 -18446744073709551616 = -2 +mod -2 18446744073709551614 = 18446744073709551612 +mod -2 85070591730234615865843651857942052864 = 85070591730234615865843651857942052862 +mod -2 85070591730234615847396907784232501249 = 85070591730234615847396907784232501247 +mod -9223372036854775808 1 = 0 +mod -9223372036854775808 -1 = 0 +mod -9223372036854775808 2 = 0 +mod -9223372036854775808 -2 = 0 +mod -9223372036854775808 -9223372036854775808 = 0 +mod -9223372036854775808 9223372036854775807 = 9223372036854775806 +mod -9223372036854775808 -9223372036854775809 = -9223372036854775808 +mod -9223372036854775808 9223372036854775808 = 0 +mod -9223372036854775808 -18446744073709551616 = -9223372036854775808 +mod -9223372036854775808 18446744073709551614 = 9223372036854775806 +mod -9223372036854775808 85070591730234615865843651857942052864 = 85070591730234615856620279821087277056 +mod -9223372036854775808 85070591730234615847396907784232501249 = 85070591730234615838173535747377725441 +mod 9223372036854775807 1 = 0 +mod 9223372036854775807 -1 = 0 +mod 9223372036854775807 2 = 1 +mod 9223372036854775807 -2 = -1 +mod 9223372036854775807 -9223372036854775808 = -1 +mod 9223372036854775807 9223372036854775807 = 0 +mod 9223372036854775807 -9223372036854775809 = -2 +mod 9223372036854775807 9223372036854775808 = 9223372036854775807 +mod 9223372036854775807 -18446744073709551616 = -9223372036854775809 +mod 9223372036854775807 18446744073709551614 = 9223372036854775807 +mod 9223372036854775807 85070591730234615865843651857942052864 = 9223372036854775807 +mod 9223372036854775807 85070591730234615847396907784232501249 = 9223372036854775807 +quot 0 1 = 0 +quot 0 -1 = 0 +quot 0 2 = 0 +quot 0 -2 = 0 +quot 0 -9223372036854775808 = 0 +quot 0 9223372036854775807 = 0 +quot 0 -9223372036854775809 = 0 +quot 0 9223372036854775808 = 0 +quot 0 -18446744073709551616 = 0 +quot 0 18446744073709551614 = 0 +quot 0 85070591730234615865843651857942052864 = 0 +quot 0 85070591730234615847396907784232501249 = 0 +quot 1 1 = 1 +quot 1 -1 = -1 +quot 1 2 = 0 +quot 1 -2 = 0 +quot 1 -9223372036854775808 = 0 +quot 1 9223372036854775807 = 0 +quot 1 -9223372036854775809 = 0 +quot 1 9223372036854775808 = 0 +quot 1 -18446744073709551616 = 0 +quot 1 18446744073709551614 = 0 +quot 1 85070591730234615865843651857942052864 = 0 +quot 1 85070591730234615847396907784232501249 = 0 +quot -1 1 = -1 +quot -1 -1 = 1 +quot -1 2 = 0 +quot -1 -2 = 0 +quot -1 -9223372036854775808 = 0 +quot -1 9223372036854775807 = 0 +quot -1 -9223372036854775809 = 0 +quot -1 9223372036854775808 = 0 +quot -1 -18446744073709551616 = 0 +quot -1 18446744073709551614 = 0 +quot -1 85070591730234615865843651857942052864 = 0 +quot -1 85070591730234615847396907784232501249 = 0 +quot 2 1 = 2 +quot 2 -1 = -2 +quot 2 2 = 1 +quot 2 -2 = -1 +quot 2 -9223372036854775808 = 0 +quot 2 9223372036854775807 = 0 +quot 2 -9223372036854775809 = 0 +quot 2 9223372036854775808 = 0 +quot 2 -18446744073709551616 = 0 +quot 2 18446744073709551614 = 0 +quot 2 85070591730234615865843651857942052864 = 0 +quot 2 85070591730234615847396907784232501249 = 0 +quot -2 1 = -2 +quot -2 -1 = 2 +quot -2 2 = -1 +quot -2 -2 = 1 +quot -2 -9223372036854775808 = 0 +quot -2 9223372036854775807 = 0 +quot -2 -9223372036854775809 = 0 +quot -2 9223372036854775808 = 0 +quot -2 -18446744073709551616 = 0 +quot -2 18446744073709551614 = 0 +quot -2 85070591730234615865843651857942052864 = 0 +quot -2 85070591730234615847396907784232501249 = 0 +quot -9223372036854775808 1 = -9223372036854775808 +quot -9223372036854775808 -1 = 9223372036854775808 +quot -9223372036854775808 2 = -4611686018427387904 +quot -9223372036854775808 -2 = 4611686018427387904 +quot -9223372036854775808 -9223372036854775808 = 1 +quot -9223372036854775808 9223372036854775807 = -1 +quot -9223372036854775808 -9223372036854775809 = 0 +quot -9223372036854775808 9223372036854775808 = -1 +quot -9223372036854775808 -18446744073709551616 = 0 +quot -9223372036854775808 18446744073709551614 = 0 +quot -9223372036854775808 85070591730234615865843651857942052864 = 0 +quot -9223372036854775808 85070591730234615847396907784232501249 = 0 +quot 9223372036854775807 1 = 9223372036854775807 +quot 9223372036854775807 -1 = -9223372036854775807 +quot 9223372036854775807 2 = 4611686018427387903 +quot 9223372036854775807 -2 = -4611686018427387903 +quot 9223372036854775807 -9223372036854775808 = 0 +quot 9223372036854775807 9223372036854775807 = 1 +quot 9223372036854775807 -9223372036854775809 = 0 +quot 9223372036854775807 9223372036854775808 = 0 +quot 9223372036854775807 -18446744073709551616 = 0 +quot 9223372036854775807 18446744073709551614 = 0 +quot 9223372036854775807 85070591730234615865843651857942052864 = 0 +quot 9223372036854775807 85070591730234615847396907784232501249 = 0 +rem 0 1 = 0 +rem 0 -1 = 0 +rem 0 2 = 0 +rem 0 -2 = 0 +rem 0 -9223372036854775808 = 0 +rem 0 9223372036854775807 = 0 +rem 0 -9223372036854775809 = 0 +rem 0 9223372036854775808 = 0 +rem 0 -18446744073709551616 = 0 +rem 0 18446744073709551614 = 0 +rem 0 85070591730234615865843651857942052864 = 0 +rem 0 85070591730234615847396907784232501249 = 0 +rem 1 1 = 0 +rem 1 -1 = 0 +rem 1 2 = 1 +rem 1 -2 = 1 +rem 1 -9223372036854775808 = 1 +rem 1 9223372036854775807 = 1 +rem 1 -9223372036854775809 = 1 +rem 1 9223372036854775808 = 1 +rem 1 -18446744073709551616 = 1 +rem 1 18446744073709551614 = 1 +rem 1 85070591730234615865843651857942052864 = 1 +rem 1 85070591730234615847396907784232501249 = 1 +rem -1 1 = 0 +rem -1 -1 = 0 +rem -1 2 = -1 +rem -1 -2 = -1 +rem -1 -9223372036854775808 = -1 +rem -1 9223372036854775807 = -1 +rem -1 -9223372036854775809 = -1 +rem -1 9223372036854775808 = -1 +rem -1 -18446744073709551616 = -1 +rem -1 18446744073709551614 = -1 +rem -1 85070591730234615865843651857942052864 = -1 +rem -1 85070591730234615847396907784232501249 = -1 +rem 2 1 = 0 +rem 2 -1 = 0 +rem 2 2 = 0 +rem 2 -2 = 0 +rem 2 -9223372036854775808 = 2 +rem 2 9223372036854775807 = 2 +rem 2 -9223372036854775809 = 2 +rem 2 9223372036854775808 = 2 +rem 2 -18446744073709551616 = 2 +rem 2 18446744073709551614 = 2 +rem 2 85070591730234615865843651857942052864 = 2 +rem 2 85070591730234615847396907784232501249 = 2 +rem -2 1 = 0 +rem -2 -1 = 0 +rem -2 2 = 0 +rem -2 -2 = 0 +rem -2 -9223372036854775808 = -2 +rem -2 9223372036854775807 = -2 +rem -2 -9223372036854775809 = -2 +rem -2 9223372036854775808 = -2 +rem -2 -18446744073709551616 = -2 +rem -2 18446744073709551614 = -2 +rem -2 85070591730234615865843651857942052864 = -2 +rem -2 85070591730234615847396907784232501249 = -2 +rem -9223372036854775808 1 = 0 +rem -9223372036854775808 -1 = 0 +rem -9223372036854775808 2 = 0 +rem -9223372036854775808 -2 = 0 +rem -9223372036854775808 -9223372036854775808 = 0 +rem -9223372036854775808 9223372036854775807 = -1 +rem -9223372036854775808 -9223372036854775809 = -9223372036854775808 +rem -9223372036854775808 9223372036854775808 = 0 +rem -9223372036854775808 -18446744073709551616 = -9223372036854775808 +rem -9223372036854775808 18446744073709551614 = -9223372036854775808 +rem -9223372036854775808 85070591730234615865843651857942052864 = -9223372036854775808 +rem -9223372036854775808 85070591730234615847396907784232501249 = -9223372036854775808 +rem 9223372036854775807 1 = 0 +rem 9223372036854775807 -1 = 0 +rem 9223372036854775807 2 = 1 +rem 9223372036854775807 -2 = 1 +rem 9223372036854775807 -9223372036854775808 = 9223372036854775807 +rem 9223372036854775807 9223372036854775807 = 0 +rem 9223372036854775807 -9223372036854775809 = 9223372036854775807 +rem 9223372036854775807 9223372036854775808 = 9223372036854775807 +rem 9223372036854775807 -18446744073709551616 = 9223372036854775807 +rem 9223372036854775807 18446744073709551614 = 9223372036854775807 +rem 9223372036854775807 85070591730234615865843651857942052864 = 9223372036854775807 +rem 9223372036854775807 85070591730234615847396907784232501249 = 9223372036854775807 +gcd 0 1 = 1 +gcd 0 -1 = 1 +gcd 0 2 = 2 +gcd 0 -2 = 2 +gcd 0 -9223372036854775808 = 9223372036854775808 +gcd 0 9223372036854775807 = 9223372036854775807 +gcd 1 0 = 1 +gcd 1 1 = 1 +gcd 1 -1 = 1 +gcd 1 2 = 1 +gcd 1 -2 = 1 +gcd 1 -9223372036854775808 = 1 +gcd 1 9223372036854775807 = 1 +gcd -1 0 = 1 +gcd -1 1 = 1 +gcd -1 -1 = 1 +gcd -1 2 = 1 +gcd -1 -2 = 1 +gcd -1 -9223372036854775808 = 1 +gcd -1 9223372036854775807 = 1 +gcd 2 0 = 2 +gcd 2 1 = 1 +gcd 2 -1 = 1 +gcd 2 2 = 2 +gcd 2 -2 = 2 +gcd 2 -9223372036854775808 = 2 +gcd 2 9223372036854775807 = 1 +gcd -2 0 = 2 +gcd -2 1 = 1 +gcd -2 -1 = 1 +gcd -2 2 = 2 +gcd -2 -2 = 2 +gcd -2 -9223372036854775808 = 2 +gcd -2 9223372036854775807 = 1 +gcd -9223372036854775808 0 = 9223372036854775808 +gcd -9223372036854775808 1 = 1 +gcd -9223372036854775808 -1 = 1 +gcd -9223372036854775808 2 = 2 +gcd -9223372036854775808 -2 = 2 +gcd -9223372036854775808 -9223372036854775808 = 9223372036854775808 +gcd -9223372036854775808 9223372036854775807 = 1 +gcd 9223372036854775807 0 = 9223372036854775807 +gcd 9223372036854775807 1 = 1 +gcd 9223372036854775807 -1 = 1 +gcd 9223372036854775807 2 = 1 +gcd 9223372036854775807 -2 = 1 +gcd 9223372036854775807 -9223372036854775808 = 1 +gcd 9223372036854775807 9223372036854775807 = 9223372036854775807 +lcm 0 1 = 0 +lcm 0 -1 = 0 +lcm 0 2 = 0 +lcm 0 -2 = 0 +lcm 0 -9223372036854775808 = 0 +lcm 0 9223372036854775807 = 0 +lcm 1 0 = 0 +lcm 1 1 = 1 +lcm 1 -1 = 1 +lcm 1 2 = 2 +lcm 1 -2 = 2 +lcm 1 -9223372036854775808 = 9223372036854775808 +lcm 1 9223372036854775807 = 9223372036854775807 +lcm -1 0 = 0 +lcm -1 1 = 1 +lcm -1 -1 = 1 +lcm -1 2 = 2 +lcm -1 -2 = 2 +lcm -1 -9223372036854775808 = 9223372036854775808 +lcm -1 9223372036854775807 = 9223372036854775807 +lcm 2 0 = 0 +lcm 2 1 = 2 +lcm 2 -1 = 2 +lcm 2 2 = 2 +lcm 2 -2 = 2 +lcm 2 -9223372036854775808 = 9223372036854775808 +lcm 2 9223372036854775807 = 18446744073709551614 +lcm -2 0 = 0 +lcm -2 1 = 2 +lcm -2 -1 = 2 +lcm -2 2 = 2 +lcm -2 -2 = 2 +lcm -2 -9223372036854775808 = 9223372036854775808 +lcm -2 9223372036854775807 = 18446744073709551614 +lcm -9223372036854775808 0 = 0 +lcm -9223372036854775808 1 = 9223372036854775808 +lcm -9223372036854775808 -1 = 9223372036854775808 +lcm -9223372036854775808 2 = 9223372036854775808 +lcm -9223372036854775808 -2 = 9223372036854775808 +lcm -9223372036854775808 -9223372036854775808 = 9223372036854775808 +lcm -9223372036854775808 9223372036854775807 = 85070591730234615856620279821087277056 +lcm 9223372036854775807 0 = 0 +lcm 9223372036854775807 1 = 9223372036854775807 +lcm 9223372036854775807 -1 = 9223372036854775807 +lcm 9223372036854775807 2 = 18446744073709551614 +lcm 9223372036854775807 -2 = 18446744073709551614 +lcm 9223372036854775807 -9223372036854775808 = 85070591730234615856620279821087277056 +lcm 9223372036854775807 9223372036854775807 = 9223372036854775807 diff --git a/testsuite/tests/numeric/should_run/arith004.hs b/testsuite/tests/numeric/should_run/arith004.hs new file mode 100644 index 0000000000..68e601128e --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith004.hs @@ -0,0 +1,86 @@ +-- !!! test quot/rem/div/mod functions on Ints and Integers +-- +main + = putStr + (-- w/ Ints and Integers + show (unzipWith div ints_list) + ++ "\n" + ++ show (unzipWith div integers_list) + ++ "\n" + ++ show (unzipWith rem ints_list) + ++ "\n" + ++ show (unzipWith rem integers_list) + ++ "\n" + ++ show (unzipWith quot ints_list) + ++ "\n" + ++ show (unzipWith quot integers_list) + ++ "\n" + ++ show (unzipWith mod ints_list) + ++ "\n" + ++ show (unzipWith mod integers_list) + ++ "\n" + ++ show (unzipWith law1 ints_list) + ++ "\n" + ++ show (unzipWith law1 integers_list) + ++ "\n" + ++ show (unzipWith law2 ints_list) + ++ "\n" + ++ show (unzipWith law2 integers_list) + ++ "\n" + ) + where + ints_list :: [(Int, Int)] + integers_list :: [(Integer, Integer)] + + ints_list = [ + (0, 4), + (0, -8), + (7, 3), + (13, 4), + (13, -4), + (-13, 4), + (-13, -4), + (12345678, 10000), + (12345678, -10000), + (-12345678, 10000), + (-12345678, -10000), + (123456,10000), + (1234567,20000), + (12345678,-10000), + (123456789,10000), + (1234567890,-10000), + (-12345,10000), + (-123456789,-10000) + ] + + integers_list = [ + (0, 4), + (0, -8), + (7, 3), + (13, 4), + (13, -4), + (-13, 4), + (-13, -4), + (12345678, 10000), + (12345678, -10000), + (-12345678, 10000), + (-12345678, -10000), + (123456,10000), + (1234567,20000), + (12345678,-10000), + (123456789,10000), + (1234567890,-10000), + (-12345,10000), + (-123456789,-10000), + (12345678900,500000000), + (1234000000000000000000005678900,5001111111111111000000) + ] + +unzipWith :: (a -> b -> c) -> [(a,b)] -> [c] +unzipWith f [] = [] +unzipWith f ((x,y):zs) = f x y : unzipWith f zs + +law1, law2 :: Integral a => a -> a -> Bool + +law1 x y = (x `quot` y)*y + (x `rem` y) == x +law2 x y = (x `div` y)*y + (x `mod` y) == x diff --git a/testsuite/tests/numeric/should_run/arith004.stdout b/testsuite/tests/numeric/should_run/arith004.stdout new file mode 100644 index 0000000000..0ce885eb27 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith004.stdout @@ -0,0 +1,12 @@ +[0,0,2,3,-4,-4,3,1234,-1235,-1235,1234,12,61,-1235,12345,-123457,-2,12345] +[0,0,2,3,-4,-4,3,1234,-1235,-1235,1234,12,61,-1235,12345,-123457,-2,12345,24,246745167] +[0,0,1,1,1,-1,-1,5678,5678,-5678,-5678,3456,14567,5678,6789,7890,-2345,-6789] +[0,0,1,1,1,-1,-1,5678,5678,-5678,-5678,3456,14567,5678,6789,7890,-2345,-6789,345678900,3703333360749468678900] +[0,0,2,3,-3,-3,3,1234,-1234,-1234,1234,12,61,-1234,12345,-123456,-1,12345] +[0,0,2,3,-3,-3,3,1234,-1234,-1234,1234,12,61,-1234,12345,-123456,-1,12345,24,246745167] +[0,0,1,1,-3,3,-1,5678,-4322,4322,-5678,3456,14567,-4322,6789,-2110,7655,-6789] +[0,0,1,1,-3,3,-1,5678,-4322,4322,-5678,3456,14567,-4322,6789,-2110,7655,-6789,345678900,3703333360749468678900] +[True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True] +[True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True] +[True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True] +[True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True] diff --git a/testsuite/tests/numeric/should_run/arith005.hs b/testsuite/tests/numeric/should_run/arith005.hs new file mode 100644 index 0000000000..179d7b33dc --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith005.hs @@ -0,0 +1,60 @@ +-- !!! test RealFrac ops (ceiling/floor/etc.) on Floats/Doubles +-- +main = + putStr $ + unlines + [ -- just for fun, we show the floats to + -- exercise the code responsible. + 'A' : show (float_list :: [Float]) + , 'B' : show (double_list :: [Double]) + -- {Float,Double} inputs, {Int,Integer} outputs + , 'C' : show ((map ceiling small_float_list) :: [Int]) + , 'D' : show ((map ceiling float_list) :: [Integer]) + , 'E' : show ((map ceiling small_double_list) :: [Int]) + , 'F' : show ((map ceiling double_list) :: [Integer]) + , 'G' : show ((map floor small_float_list) :: [Int]) + , 'H' : show ((map floor float_list) :: [Integer]) + , 'I' : show ((map floor small_double_list) :: [Int]) + , 'J' : show ((map floor double_list) :: [Integer]) + , 'K' : show ((map truncate small_float_list) :: [Int]) + , 'L' : show ((map truncate float_list) :: [Integer]) + , 'M' : show ((map truncate small_double_list) :: [Int]) + , 'N' : show ((map truncate double_list) :: [Integer]) + , 'n' : show ((map round small_float_list) :: [Int]) + , 'O' : show ((map round float_list) :: [Integer]) + , 'P' : show ((map round small_double_list) :: [Int]) + , 'Q' : show ((map round double_list) :: [Integer]) + , 'R' : show ((map properFraction small_float_list) :: [(Int,Float)]) + , 'S' : show ((map properFraction float_list) :: [(Integer,Float)]) + , 'T' : show ((map properFraction small_double_list) :: [(Int,Double)]) + , 'U' : show ((map properFraction double_list) :: [(Integer,Double)]) + ] + where + -- these fit into an Int when truncated. Truncation when the + -- result does not fit into the target is undefined - not explicitly + -- so in Haskell 98, but that's the interpretation we've taken in GHC. + -- See bug #1254 + small_float_list :: [Float] + small_float_list = [ + 0.0, -0.0, 1.1, 2.8, 3.5, 4.5, -1.0000000001, -2.9999995, + -3.50000000001, -4.49999999999, 1000012.0, 123.456, 100.25, + 102.5, 0.0012, -0.00000012, 1.7e4, -1.7e-4, 0.15e-6, pi + ] + + float_list :: [Float] + float_list = small_float_list ++ [ + 1.18088e+11, 1.2111e+14 + ] + + -- these fit into an Int + small_double_list :: [Double] + small_double_list = [ + 0.0, -0.0, 1.1, 2.8, 3.5, 4.5, -1.0000000001, -2.9999995, + -3.50000000001, -4.49999999999, 1000012.0, 123.456, 100.25, + 102.5, 0.0012, -0.00000012, 1.7e4, -1.7e-4, 0.15e-6, pi + ] + + double_list :: [Double] + double_list = small_double_list ++ [ + 1.18088e+11, 1.2111e+14 + ] diff --git a/testsuite/tests/numeric/should_run/arith005.stdout b/testsuite/tests/numeric/should_run/arith005.stdout new file mode 100644 index 0000000000..8881543412 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith005.stdout @@ -0,0 +1,22 @@ +A[0.0,-0.0,1.1,2.8,3.5,4.5,-1.0,-2.9999995,-3.5,-4.5,1000012.0,123.456,100.25,102.5,1.2e-3,-1.2e-7,17000.0,-1.7e-4,1.5e-7,3.1415927,1.18088e11,1.2111e14] +B[0.0,-0.0,1.1,2.8,3.5,4.5,-1.0000000001,-2.9999995,-3.50000000001,-4.49999999999,1000012.0,123.456,100.25,102.5,1.2e-3,-1.2e-7,17000.0,-1.7e-4,1.5e-7,3.141592653589793,1.18088e11,1.2111e14] +C[0,0,2,3,4,5,-1,-2,-3,-4,1000012,124,101,103,1,0,17000,0,1,4] +D[0,0,2,3,4,5,-1,-2,-3,-4,1000012,124,101,103,1,0,17000,0,1,4,118087999488,121109999517696] +E[0,0,2,3,4,5,-1,-2,-3,-4,1000012,124,101,103,1,0,17000,0,1,4] +F[0,0,2,3,4,5,-1,-2,-3,-4,1000012,124,101,103,1,0,17000,0,1,4,118088000000,121110000000000] +G[0,0,1,2,3,4,-1,-3,-4,-5,1000012,123,100,102,0,-1,17000,-1,0,3] +H[0,0,1,2,3,4,-1,-3,-4,-5,1000012,123,100,102,0,-1,17000,-1,0,3,118087999488,121109999517696] +I[0,0,1,2,3,4,-2,-3,-4,-5,1000012,123,100,102,0,-1,17000,-1,0,3] +J[0,0,1,2,3,4,-2,-3,-4,-5,1000012,123,100,102,0,-1,17000,-1,0,3,118088000000,121110000000000] +K[0,0,1,2,3,4,-1,-2,-3,-4,1000012,123,100,102,0,0,17000,0,0,3] +L[0,0,1,2,3,4,-1,-2,-3,-4,1000012,123,100,102,0,0,17000,0,0,3,118087999488,121109999517696] +M[0,0,1,2,3,4,-1,-2,-3,-4,1000012,123,100,102,0,0,17000,0,0,3] +N[0,0,1,2,3,4,-1,-2,-3,-4,1000012,123,100,102,0,0,17000,0,0,3,118088000000,121110000000000] +n[0,0,1,3,4,4,-1,-3,-4,-4,1000012,123,100,102,0,0,17000,0,0,3] +O[0,0,1,3,4,4,-1,-3,-4,-4,1000012,123,100,102,0,0,17000,0,0,3,118087999488,121109999517696] +P[0,0,1,3,4,4,-1,-3,-4,-4,1000012,123,100,102,0,0,17000,0,0,3] +Q[0,0,1,3,4,4,-1,-3,-4,-4,1000012,123,100,102,0,0,17000,0,0,3,118088000000,121110000000000] +R[(0,0.0),(0,0.0),(1,0.100000024),(2,0.79999995),(3,0.5),(4,0.5),(-1,0.0),(-2,-0.9999995),(-3,-0.5),(-4,-0.5),(1000012,0.0),(123,0.45600128),(100,0.25),(102,0.5),(0,1.2e-3),(0,-1.2e-7),(17000,0.0),(0,-1.7e-4),(0,1.5e-7),(3,0.14159274)] +S[(0,0.0),(0,0.0),(1,0.100000024),(2,0.79999995),(3,0.5),(4,0.5),(-1,0.0),(-2,-0.9999995),(-3,-0.5),(-4,-0.5),(1000012,0.0),(123,0.45600128),(100,0.25),(102,0.5),(0,1.2e-3),(0,-1.2e-7),(17000,0.0),(0,-1.7e-4),(0,1.5e-7),(3,0.14159274),(118087999488,0.0),(121109999517696,0.0)] +T[(0,0.0),(0,0.0),(1,0.10000000000000009),(2,0.7999999999999998),(3,0.5),(4,0.5),(-1,-1.000000082740371e-10),(-2,-0.9999994999999999),(-3,-0.50000000001),(-4,-0.49999999999),(1000012,0.0),(123,0.45600000000000307),(100,0.25),(102,0.5),(0,1.2e-3),(0,-1.2e-7),(17000,0.0),(0,-1.7e-4),(0,1.5e-7),(3,0.14159265358979312)] +U[(0,0.0),(0,0.0),(1,0.10000000000000009),(2,0.7999999999999998),(3,0.5),(4,0.5),(-1,-1.000000082740371e-10),(-2,-0.9999994999999999),(-3,-0.50000000001),(-4,-0.49999999999),(1000012,0.0),(123,0.45600000000000307),(100,0.25),(102,0.5),(0,1.2e-3),(0,-1.2e-7),(17000,0.0),(0,-1.7e-4),(0,1.5e-7),(3,0.14159265358979312),(118088000000,0.0),(121110000000000,0.0)] diff --git a/testsuite/tests/numeric/should_run/arith005.stdout-ws-64 b/testsuite/tests/numeric/should_run/arith005.stdout-ws-64 new file mode 100644 index 0000000000..8881543412 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith005.stdout-ws-64 @@ -0,0 +1,22 @@ +A[0.0,-0.0,1.1,2.8,3.5,4.5,-1.0,-2.9999995,-3.5,-4.5,1000012.0,123.456,100.25,102.5,1.2e-3,-1.2e-7,17000.0,-1.7e-4,1.5e-7,3.1415927,1.18088e11,1.2111e14] +B[0.0,-0.0,1.1,2.8,3.5,4.5,-1.0000000001,-2.9999995,-3.50000000001,-4.49999999999,1000012.0,123.456,100.25,102.5,1.2e-3,-1.2e-7,17000.0,-1.7e-4,1.5e-7,3.141592653589793,1.18088e11,1.2111e14] +C[0,0,2,3,4,5,-1,-2,-3,-4,1000012,124,101,103,1,0,17000,0,1,4] +D[0,0,2,3,4,5,-1,-2,-3,-4,1000012,124,101,103,1,0,17000,0,1,4,118087999488,121109999517696] +E[0,0,2,3,4,5,-1,-2,-3,-4,1000012,124,101,103,1,0,17000,0,1,4] +F[0,0,2,3,4,5,-1,-2,-3,-4,1000012,124,101,103,1,0,17000,0,1,4,118088000000,121110000000000] +G[0,0,1,2,3,4,-1,-3,-4,-5,1000012,123,100,102,0,-1,17000,-1,0,3] +H[0,0,1,2,3,4,-1,-3,-4,-5,1000012,123,100,102,0,-1,17000,-1,0,3,118087999488,121109999517696] +I[0,0,1,2,3,4,-2,-3,-4,-5,1000012,123,100,102,0,-1,17000,-1,0,3] +J[0,0,1,2,3,4,-2,-3,-4,-5,1000012,123,100,102,0,-1,17000,-1,0,3,118088000000,121110000000000] +K[0,0,1,2,3,4,-1,-2,-3,-4,1000012,123,100,102,0,0,17000,0,0,3] +L[0,0,1,2,3,4,-1,-2,-3,-4,1000012,123,100,102,0,0,17000,0,0,3,118087999488,121109999517696] +M[0,0,1,2,3,4,-1,-2,-3,-4,1000012,123,100,102,0,0,17000,0,0,3] +N[0,0,1,2,3,4,-1,-2,-3,-4,1000012,123,100,102,0,0,17000,0,0,3,118088000000,121110000000000] +n[0,0,1,3,4,4,-1,-3,-4,-4,1000012,123,100,102,0,0,17000,0,0,3] +O[0,0,1,3,4,4,-1,-3,-4,-4,1000012,123,100,102,0,0,17000,0,0,3,118087999488,121109999517696] +P[0,0,1,3,4,4,-1,-3,-4,-4,1000012,123,100,102,0,0,17000,0,0,3] +Q[0,0,1,3,4,4,-1,-3,-4,-4,1000012,123,100,102,0,0,17000,0,0,3,118088000000,121110000000000] +R[(0,0.0),(0,0.0),(1,0.100000024),(2,0.79999995),(3,0.5),(4,0.5),(-1,0.0),(-2,-0.9999995),(-3,-0.5),(-4,-0.5),(1000012,0.0),(123,0.45600128),(100,0.25),(102,0.5),(0,1.2e-3),(0,-1.2e-7),(17000,0.0),(0,-1.7e-4),(0,1.5e-7),(3,0.14159274)] +S[(0,0.0),(0,0.0),(1,0.100000024),(2,0.79999995),(3,0.5),(4,0.5),(-1,0.0),(-2,-0.9999995),(-3,-0.5),(-4,-0.5),(1000012,0.0),(123,0.45600128),(100,0.25),(102,0.5),(0,1.2e-3),(0,-1.2e-7),(17000,0.0),(0,-1.7e-4),(0,1.5e-7),(3,0.14159274),(118087999488,0.0),(121109999517696,0.0)] +T[(0,0.0),(0,0.0),(1,0.10000000000000009),(2,0.7999999999999998),(3,0.5),(4,0.5),(-1,-1.000000082740371e-10),(-2,-0.9999994999999999),(-3,-0.50000000001),(-4,-0.49999999999),(1000012,0.0),(123,0.45600000000000307),(100,0.25),(102,0.5),(0,1.2e-3),(0,-1.2e-7),(17000,0.0),(0,-1.7e-4),(0,1.5e-7),(3,0.14159265358979312)] +U[(0,0.0),(0,0.0),(1,0.10000000000000009),(2,0.7999999999999998),(3,0.5),(4,0.5),(-1,-1.000000082740371e-10),(-2,-0.9999994999999999),(-3,-0.50000000001),(-4,-0.49999999999),(1000012,0.0),(123,0.45600000000000307),(100,0.25),(102,0.5),(0,1.2e-3),(0,-1.2e-7),(17000,0.0),(0,-1.7e-4),(0,1.5e-7),(3,0.14159265358979312),(118088000000,0.0),(121110000000000,0.0)] diff --git a/testsuite/tests/numeric/should_run/arith006.hs b/testsuite/tests/numeric/should_run/arith006.hs new file mode 100644 index 0000000000..b837692dae --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith006.hs @@ -0,0 +1,4 @@ +-- !!! printing Floats; was a bug in hbc (reported by andy) +-- + +main = print ((fromIntegral (42 :: Int)) :: Float) diff --git a/testsuite/tests/numeric/should_run/arith006.stdout b/testsuite/tests/numeric/should_run/arith006.stdout new file mode 100644 index 0000000000..713c2229f5 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith006.stdout @@ -0,0 +1 @@ +42.0 diff --git a/testsuite/tests/numeric/should_run/arith007.hs b/testsuite/tests/numeric/should_run/arith007.hs new file mode 100644 index 0000000000..3d42d1fb10 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith007.hs @@ -0,0 +1,23 @@ +-- !!! test simple Integer things +-- + +f x y z = x y z + +main = do + putStr (shows integer_list "\n") + where + int_list :: [Int] + integer_list :: [Integer] + + int_list = (map fromInteger integer_list) + + integer_list = (map (* 2) + [1,3,5,7,9, + 11111111111111111111111111111, + 2222222222222222222222222222222222222, + 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333, + -11111111111111111111111111111, + -2222222222222222222222222222222222222, + -3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 + ]) + diff --git a/testsuite/tests/numeric/should_run/arith007.stdout b/testsuite/tests/numeric/should_run/arith007.stdout new file mode 100644 index 0000000000..1d7c97d108 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith007.stdout @@ -0,0 +1 @@ +[2,6,10,14,18,22222222222222222222222222222,4444444444444444444444444444444444444,6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666,-22222222222222222222222222222,-4444444444444444444444444444444444444,-6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666] diff --git a/testsuite/tests/numeric/should_run/arith008.hs b/testsuite/tests/numeric/should_run/arith008.hs new file mode 100644 index 0000000000..15a3903a0e --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith008.hs @@ -0,0 +1,24 @@ +-- !!! a random test from Nick North +-- (got this in mid-1993; don't remember why. WDP 95/02) +-- + +random_numbers :: (Int, Int, Int) -> [Float] +random_numbers (s1,s2,s3) + = map (snd . properFraction . combine) (iterate f (s1,s2,s3)) + where + combine :: (Int,Int,Int) -> Float + combine (a,b,c) = + fromIntegral(a)/30269 + fromIntegral(b)/30307 + + fromIntegral(c)/30323 + f (a,b,c) = + ((171*a) `mod` 30269, (172*b) `mod` 30307, (170*c) `mod` 30323) + +-- partain: changed to cvt spaces into newlines (easier to see bugs) +-- sof: define approp. version of showList to do this. +main = putStr (showL (showsPrec 0) (take 1000 (random_numbers (9807, 65, 32975))) "\n") + +showL showx [] = showString "[]" +showL showx (x:xs) = showChar '[' . showx x . showl xs + where + showl [] = showChar ']' + showl (x:xs) = showString ",\n" . showx x . showl xs diff --git a/testsuite/tests/numeric/should_run/arith008.stdout b/testsuite/tests/numeric/should_run/arith008.stdout new file mode 100644 index 0000000000..6a6007c745 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith008.stdout @@ -0,0 +1,1000 @@ +[0.41359794, +0.6399324, +0.92941284, +0.8322308, +0.6558542, +0.27844667, +0.48358274, +0.21114683, +0.7582127, +0.12166107, +0.981663, +0.79931486, +0.8722358, +0.45195377, +3.4911394e-2, +0.7246227, +0.24528801, +0.6998143, +0.9876834, +0.42533565, +0.59525573, +0.38930762, +0.119990826, +0.9083969, +0.26239872, +2.744031e-2, +0.7286656, +0.92476606, +0.8718927, +0.1687454, +0.13774204, +0.28789735, +0.9548291, +0.41255307, +0.8564267, +8.4107876e-2, +0.48756683, +0.11202359, +0.51587105, +0.5511048, +0.93413484, +0.6428783, +0.87145376, +0.67891765, +0.23348927, +0.3780495, +0.87735546, +0.85223985, +0.19405353, +0.3535874, +0.72997916, +0.23668802, +0.61755717, +0.9253086, +0.7007494, +0.98090434, +0.23180747, +0.8951179, +0.18330741, +0.30362415, +0.57720375, +0.8465313, +0.31598616, +0.20875359, +0.18506193, +0.56406593, +0.87965286, +2.7450562e-2, +0.14676762, +0.74345183, +0.92644644, +1.5535355e-3, +0.8126061, +0.6636951, +0.15379143, +0.16009843, +0.29956555, +0.71643496, +0.65267706, +1.2942791e-2, +0.15469885, +0.70281076, +0.49925303, +0.9001132, +0.55416614, +0.2577113, +0.28545964, +0.26130748, +0.91633797, +0.2018559, +0.88357884, +0.6068319, +0.41902173, +0.80342615, +0.5469477, +0.5351703, +0.36879182, +0.85823405, +0.18722737, +0.20447707, +0.5052972, +0.41609886, +0.13425875, +0.8554218, +0.37205708, +9.450865e-2, +0.97575045, +0.8755969, +0.7150241, +0.6752708, +0.6860019, +0.21408677, +0.30702153, +0.3567884, +0.6356261, +0.84917825, +0.13312805, +0.1351955, +0.2726475, +0.77746105, +0.39467335, +0.42776418, +0.15337801, +0.1592257, +0.28089368, +0.6215863, +0.15158892, +0.62589145, +0.9849372, +0.47261155, +0.13879633, +0.53436935, +0.8684354, +0.49009013, +0.8487663, +0.415954, +0.49733603, +0.81666195, +0.50797117, +0.19971132, +0.5820248, +0.9983189, +0.27208292, +0.67335844, +0.27931952, +0.42391694, +0.9081789, +7.466531e-2, +5.3013563e-2, +0.2840109, +0.4830655, +0.1756686, +0.62167895, +0.89717495, +0.19109178, +0.78958845, +1.543045e-2, +5.0975323e-2, +0.21466875, +0.4129461, +0.289948, +0.7271167, +0.99582183, +6.0527444e-2, +0.75902903, +0.6639817, +0.8994356, +2.9090405e-2, +0.3309772, +0.8311074, +0.27760005, +1.6489744e-2, +4.7184825e-2, +6.268692e-2, +0.37376666, +0.9638035, +0.80776775, +0.690861, +0.6061044, +0.6701783, +0.8412647, +0.5805452, +0.41863844, +0.5514518, +0.5801554, +9.124398e-2, +0.737221, +0.24314034, +0.74114823, +0.32066846, +1.3154507e-2, +0.50678635, +0.5137007, +0.551865, +0.69038117, +0.61931777, +0.70399594, +0.9727828, +0.20246375, +0.85520244, +5.0735712e-2, +0.9930371, +0.30815053, +0.22076559, +0.32370973, +0.17521977, +0.43994308, +0.9906125, +0.5326147, +0.66132426, +7.4525714e-2, +1.51029825e-2, +3.151095e-2, +0.8795854, +0.1700325, +0.2575338, +0.75477123, +0.8775394, +0.53388363, +0.7104862, +0.13311696, +0.73177624, +0.19375706, +0.88381815, +0.75322676, +0.6076188, +0.48591495, +0.53411245, +0.7115935, +0.48955488, +0.59558845, +0.9807129, +0.8284396, +0.95038444, +0.59036994, +0.52881944, +0.9948325, +0.49523282, +0.7008028, +0.78729224, +0.9902679, +0.5339551, +4.0822983e-2, +0.37561977, +0.5063989, +0.28711128, +0.32709387, +0.8450576, +0.64256006, +0.906507, +4.6909094e-2, +0.637144, +0.16923797, +0.7377299, +0.30585575, +0.3570485, +0.98593795, +0.5611129, +7.524538e-2, +0.8517368, +0.74607563, +0.4913547, +0.83715105, +0.59740007, +0.9108657, +0.14394355, +8.5148096e-2, +0.582165, +2.120018e-3, +0.705053, +0.97463274, +0.58965266, +0.6484089, +0.79429245, +0.7779026, +0.3388164, +0.35976696, +9.1204405e-2, +0.6134187, +0.8495743, +0.9256909, +0.8651266, +0.19850588, +0.7568064, +0.44688892, +0.89375556, +0.28960586, +0.5118885, +0.39481246, +0.23119497, +0.99098516, +0.6882521, +2.3570538e-2, +0.46816385, +0.43301296, +5.7090998e-2, +0.7131885, +0.49999893, +0.8016077, +0.6981158, +0.7528713, +0.50114954, +0.86821973, +0.88443303, +0.4772892, +0.80758643, +0.38138628, +8.940506e-2, +0.6924608, +0.52786016, +0.802331, +0.98923236, +0.17653704, +0.68997073, +0.1820991, +0.64604473, +0.38469362, +0.8968754, +0.15813422, +0.868925, +4.019952e-2, +0.25560212, +0.3128089, +0.41993904, +0.948833, +0.826739, +0.10151219, +0.787004, +0.9594268, +0.14901423, +0.1414566, +0.24321175, +9.9901915e-2, +0.8921989, +0.32741654, +0.6458428, +0.16487455, +0.12096548, +0.48751688, +5.245471e-2, +0.71360433, +0.94619334, +0.2514913, +0.31235778, +0.3618456, +0.57202005, +8.347988e-3, +0.1945982, +0.6956324, +0.9895966, +0.87327766, +0.26017582, +0.47406793, +0.9971419, +0.5826107, +0.17589438, +0.89086056, +0.18030643, +0.4091003, +0.39576983, +0.38442576, +0.13684058, +8.986688e-2, +0.17313194, +0.7679503, +0.36211073, +0.82255757, +0.9100534, +0.6802888, +0.11309266, +0.47404623, +0.8113966, +0.42064667, +0.42901254, +0.14277196, +0.1055603, +0.57029915, +0.5498085, +0.71666944, +0.13909936, +6.697273e-2, +0.30388212, +0.84999645, +0.61905026, +0.80875367, +0.7628211, +0.7617794, +0.24128532, +0.8171586, +0.7165446, +0.29046047, +5.484104e-3, +0.29707146, +0.45159855, +0.8470775, +0.9105661, +0.6157371, +0.24743724, +0.26728547, +0.3399787, +0.30999124, +0.27707434, +0.26195288, +0.57788026, +0.98340875, +0.7114443, +0.10142648, +0.8840177, +0.3299948, +0.27686334, +0.66194046, +0.5837232, +0.34851027, +0.61612344, +0.60064816, +2.1667004e-2, +0.51634264, +0.5840348, +0.54137635, +0.93811476, +0.88630515, +0.35464, +0.659227, +0.74290437, +0.6366904, +0.12916958, +0.19237244, +4.462242e-3, +8.1073284e-2, +0.847996, +0.8305576, +9.401786e-2, +0.17688239, +0.36067092, +0.56400156, +0.4449073, +0.80550474, +0.94339013, +0.2624426, +0.43337846, +0.79860497, +0.9083978, +7.7695847e-3, +0.28432655, +0.8844242, +0.43196678, +0.5022042, +0.71939504, +0.87787163, +2.2063255e-2, +0.5932679, +0.88764143, +0.6470535, +2.7034998e-2, +0.72032475, +0.19539523, +0.77757996, +0.37001276, +0.84153897, +0.6239723, +0.3756181, +6.846321e-2, +0.8378935, +0.59974074, +0.68847823, +0.7352172, +1.07290745e-2, +0.5101199, +0.85353947, +0.14964247, +0.5860499, +0.17709386, +0.89342284, +0.17894697, +0.5400078, +0.4210199, +0.23370409, +0.5818304, +0.68282104, +5.1081896e-2, +0.9042077, +0.3783505, +0.44932246, +0.6200993, +0.18954074, +0.4474795, +0.31125343, +0.8426063, +6.332576e-2, +0.8104075, +0.8648635, +0.44148827, +0.84095, +0.79439354, +0.5551748, +0.687835, +0.118896365, +0.4412912, +0.57976437, +0.6679896, +0.30952072, +0.35373104, +0.18037248, +9.540319e-3, +0.48488736, +0.1673789, +0.73954326, +0.56652427, +0.49777925, +0.5246444, +0.6702163, +0.87621975, +0.359416, +0.832193, +0.18441534, +0.20517778, +0.32071996, +0.65496826, +3.7642956e-2, +0.5331861, +0.29038882, +0.35165787, +0.655563, +0.7891048, +0.14961207, +1.6696453e-3, +0.47526348, +0.82897127, +4.0933132e-2, +0.24862742, +0.44936025, +0.2355707, +0.13713741, +0.7814115, +0.80927956, +0.583858, +0.7193563, +0.19353557, +0.36663485, +0.107114315, +0.72664094, +0.121150136, +0.6676494, +0.3600223, +0.90352046, +0.9873058, +0.8213589, +0.4037695, +0.42661357, +0.8075288, +0.49739814, +0.708357, +0.89534307, +2.7906299e-2, +0.5197699, +0.5873811, +0.37502038, +0.25809133, +0.41655612, +0.35278225, +0.16273963, +0.66940236, +0.97849786, +0.28304625, +0.6673634, +0.19332111, +0.7478994, +0.59783196, +7.6501966e-2, +0.32878637, +0.5024115, +0.7220932, +0.8336895, +0.56268775, +0.89503884, +0.9931685, +0.3670969, +0.6999072, +0.77585983, +0.31907177, +0.76584256, +4.325044e-2, +0.29987824, +0.89478886, +0.21245062, +0.2749796, +0.27403784, +0.12384033, +8.77223e-2, +0.6968431, +0.41428828, +0.86889815, +0.93862987, +0.28137636, +0.4471743, +0.2681458, +0.16012955, +0.62948954, +0.7444658, +0.57012916, +0.10132849, +0.8278511, +0.19847322, +0.50814533, +0.62132853, +0.18225956, +0.16162908, +0.43761563, +0.10031223, +0.75076735, +0.75551176, +0.5453377, +0.5066473, +0.42767167, +0.5992305, +0.9446988, +0.41565955, +0.9331987, +0.9897334, +0.89694524, +0.6788764, +0.85561335, +0.6666684, +0.80166984, +0.40720224, +0.86944854, +0.92634535, +0.27878547, +0.8053527, +0.6522385, +0.5152416, +0.17939234, +0.24954629, +0.6818764, +0.7267182, +0.36313987, +9.25622e-2, +0.84685767, +0.4344505, +0.692098, +0.34008884, +5.9524536e-2, +3.827691e-2, +0.9333053, +0.2090958, +0.5924697, +0.61903036, +0.30183077, +0.4231342, +0.49257803, +0.83910036, +0.43436274, +0.9565089, +0.2666788, +4.047084e-2, +0.41260076, +0.84976804, +0.9851905, +0.62259483, +0.8959986, +0.31737566, +0.3398435, +0.27567053, +0.9734041, +0.77031887, +0.8473544, +0.3174919, +0.58769834, +0.34807217, +0.5406821, +0.8544055, +0.62600684, +0.33839083, +0.9849396, +1.2942314e-2, +0.1475277, +0.4787073, +0.54596233, +0.1752423, +0.77059823, +9.041047e-2, +0.2985853, +0.23247159, +0.23486897, +0.23700523, +0.47728157, +0.49480152, +0.72553325, +0.19682777, +0.88427216, +6.551409e-2, +0.6175699, +0.8277023, +0.2039113, +0.9962605, +0.9707756, +9.154308e-2, +0.123990774, +0.41500008, +0.45899975, +0.7904736, +0.64120626, +0.29223895, +0.48712683, +0.16071367, +0.7799654, +0.7871841, +0.34515953, +0.24462819, +0.7682588, +0.45865273, +0.97019315, +0.52276766, +1.2032986e-3, +0.2552061, +0.35652947, +1.6108036e-2, +0.22363806, +6.0125113e-2, +0.6667728, +0.13875532, +0.48999977, +0.21847558, +0.12436485, +0.6117995, +0.96883655, +0.7170677, +0.7637136, +0.50507927, +0.88803625, +0.6205857, +0.22137904, +0.97533226, +0.9804591, +0.97967625, +7.506108e-2, +0.27170992, +0.8107689, +0.76826, +0.8306192, +0.77724457, +0.80831075, +0.76732874, +8.157933e-2, +0.3223102, +0.8257649, +0.973259, +7.5988054e-2, +0.5415702, +0.25776172, +0.76154125, +0.91835296, +0.837816, +0.68698716, +0.99165297, +0.36068523, +0.53661215, +0.94795275, +0.24835014, +0.53556097, +0.7917472, +0.17282593, +0.44980502, +0.8159183, +0.2109356, +8.1673145e-2, +0.9069164, +0.8804593, +0.38818514, +0.42148066, +0.84182596, +0.85033655, +0.11290777, +0.9591603, +0.9008815, +0.12636256, +0.62351793, +0.5625932, +0.40783405, +0.9398462, +0.9048507, +0.70350707, +0.5732843, +0.9578413, +0.471671, +0.80402017, +0.23877287, +2.8808951e-2, +0.79105496, +0.39669204, +0.5252528, +5.068612e-2, +0.17306566, +0.33026814, +0.8069451, +0.774801, +0.29274237, +0.9410742, +0.24736834, +0.45892864, +0.32286835, +9.423089e-2, +0.23926187, +0.938661, +0.11605501, +0.7519337, +0.44994712, +0.8859633, +0.79223514, +0.7983874, +7.165241e-2, +0.9462296, +0.8046231, +0.9736757, +0.9235935, +0.85922825, +0.14425218, +0.96055603, +0.4746909, +0.3689847, +0.3266207, +0.6575446, +0.90298265, +0.612165, +0.94542164, +4.7265768e-2, +0.9178722, +0.7290449, +0.7926531, +0.8426634, +0.79898036, +1.8381119e-2, +5.914831e-2, +0.5302744, +0.3689797, +0.4085008, +8.593702e-2, +0.8765965, +2.9750824e-2, +0.23264515, +0.15577197, +0.21319818, +0.21833336, +0.3431382, +0.6172347, +0.5659256, +0.9447398, +0.7262399, +0.7598543, +0.56384385, +0.845103, +0.4162705, +0.13864326, +0.7863791, +0.13542509, +0.6184137, +0.2607739, +0.15591526, +0.77601504, +0.76669025, +0.56118643, +1.807928e-2, +0.31010872, +0.8704659, +0.98514426, +0.40933478, +0.1785686, +0.48007095, +8.039451e-2, +3.796923e-2, +0.8610754, +0.9595243, +0.9287634, +7.802105e-2, +0.8274702, +0.6773733, +0.97041106, +0.2371938, +0.7191273, +0.36731863, +0.6625139, +0.3092258, +0.47899795, +2.6395798e-2, +4.1056633e-2, +0.7962029, +0.5768552, +0.5356126, +1.3688564e-2, +0.41969243, +0.8178707, +0.5881722, +0.4442004, +0.42637897, +0.76563597, +8.336306e-3, +3.3709526e-2, +0.53669834, +0.53756106, +0.31038988, +0.41079557, +0.39238024, +0.24557912, +9.8520994e-2, +0.6807518, +0.12773252, +0.67073166, +0.34699106, +0.9979162, +0.42680383, +0.9087982, +0.6900128, +0.94652975, +0.17221642, +0.33502197, +0.30609477, +0.70375323, +0.41938114, +0.8668362, +0.77143216, +8.8229895e-2, +0.18202114, +0.21520734, +0.10074675, +0.38907886, +5.9812307e-2, +0.62150526, +0.99084735, +0.31110406, +0.7914846, +0.8661854, +0.518523, +0.6151075, +0.9395801, +0.4002422, +0.35337317, +0.40262416, +0.7039368, +0.935411, +1.2230396e-2, +0.6683055, +0.11150932, +5.5537343e-2, +8.355498e-2, +0.6007279, +0.4403205, +0.5811975, +0.86318696, +5.6501627e-2, +0.23753202, +0.9949539, +0.64893156, +0.90060663, +0.14257383, +0.8300431, +0.37252688, +0.18130136, +0.20323014, +0.4809363, +0.8961161, +0.23287201, +0.43141174, +0.3489914, +0.51495457, +0.8010473, +0.23635447, +0.54324985, +0.69954085, +0.48034823, +0.68947554, +0.77823305, +0.7533914, +0.24090028, +0.8162971, +0.46965337, +0.59434736, +0.1630373, +0.6848186, +1.57516e-2, +0.8775939, +0.99723464, +0.4292655, +0.47325504, +0.8548535, +0.4219792, +0.7294735, +0.77217937, +0.8508531, +0.117975116, +0.36563516, +0.37111998, +0.3301561, +6.940341e-2, +0.5864358, +0.113250256, +0.67253065, +0.8080728, +0.44792616, +0.34973896, +0.25323582] diff --git a/testsuite/tests/numeric/should_run/arith009.hs b/testsuite/tests/numeric/should_run/arith009.hs new file mode 100644 index 0000000000..43fe1b2923 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith009.hs @@ -0,0 +1,6 @@ +-- a prefix minus precedence test + +f :: Int -> Int -> Int -> Int +f x y z = - x * y ^ z + +main = putStr (shows (f 5 2 3) "\n") diff --git a/testsuite/tests/numeric/should_run/arith009.stdout b/testsuite/tests/numeric/should_run/arith009.stdout new file mode 100644 index 0000000000..949a11b741 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith009.stdout @@ -0,0 +1 @@ +-40 diff --git a/testsuite/tests/numeric/should_run/arith010.hs b/testsuite/tests/numeric/should_run/arith010.hs new file mode 100644 index 0000000000..846f76e4d1 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith010.hs @@ -0,0 +1,11 @@ +-- Tests enumerations + +main = do + print [1..10] + print [10..1] -- [] + print [1,3..10] + print [10,8..1] + print ['a'..'f'] + print ['f'..'a'] -- [] + print ['a','c'..'m'] + print ['m','l'..'a'] diff --git a/testsuite/tests/numeric/should_run/arith010.stdout b/testsuite/tests/numeric/should_run/arith010.stdout new file mode 100644 index 0000000000..e6a2b37721 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith010.stdout @@ -0,0 +1,8 @@ +[1,2,3,4,5,6,7,8,9,10] +[] +[1,3,5,7,9] +[10,8,6,4,2] +"abcdef" +"" +"acegikm" +"mlkjihgfedcba" diff --git a/testsuite/tests/numeric/should_run/arith011.hs b/testsuite/tests/numeric/should_run/arith011.hs new file mode 100644 index 0000000000..308cc824a6 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith011.hs @@ -0,0 +1,174 @@ +-- !!! Testing Int and Word +module Main(main) where +import Data.Int +import Data.Word +import Data.Bits +import Data.Ix -- added SOF +import Control.Exception + +main :: IO () +main = test + +test :: IO () +test = do + testIntlike "Int" (0::Int) + testIntlike "Int8" (0::Int8) + testIntlike "Int16" (0::Int16) + testIntlike "Int32" (0::Int32) + testIntlike "Int64" (0::Int64) + testIntlike "Word8" (0::Word8) + testIntlike "Word16" (0::Word16) + testIntlike "Word32" (0::Word32) + testIntlike "Word64" (0::Word64) + testInteger + +testIntlike :: (Bounded a, Integral a, Ix a, Read a, Bits a) => String -> a -> IO () +testIntlike name zero = do + putStrLn $ "--------------------------------" + putStrLn $ "--Testing " ++ name + putStrLn $ "--------------------------------" + testBounded zero + testEnum zero + testReadShow zero + testEq zero + testOrd zero + testNum zero + testReal zero + testIntegral zero + testConversions zero + testBits zero True + +testInteger = do + let zero = 0 :: Integer + putStrLn $ "--------------------------------" + putStrLn $ "--Testing Integer" + putStrLn $ "--------------------------------" + testEnum zero + testReadShow zero + testEq zero + testOrd zero + testNum zero + testReal zero + testIntegral zero + testBits zero False + +-- In all these tests, zero is a dummy element used to get +-- the overloading to work + +testBounded zero = do + putStrLn "testBounded" + print $ (minBound-1, minBound, minBound+1) `asTypeOf` (zero,zero,zero) + print $ (maxBound-1, maxBound, maxBound+1) `asTypeOf` (zero,zero,zero) + +testEnum zero = do + putStrLn "testEnum" + print $ take 10 [zero .. ] -- enumFrom + print $ take 10 [zero, toEnum 2 .. ] -- enumFromThen + print [zero .. toEnum 20] -- enumFromTo + print [zero, toEnum 2 .. toEnum 20] -- enumFromThenTo + +testConversions zero = do + putStrLn "testConversions" + putStr "Integer : " >> print (map fromIntegral numbers :: [Integer]) + putStr "Int : " >> print (map fromIntegral numbers :: [Int]) + putStr "Int8 : " >> print (map fromIntegral numbers :: [Int8]) + putStr "Int16 : " >> print (map fromIntegral numbers :: [Int16]) + putStr "Int32 : " >> print (map fromIntegral numbers :: [Int32]) + putStr "Int64 : " >> print (map fromIntegral numbers :: [Int64]) + putStr "Word8 : " >> print (map fromIntegral numbers :: [Word8]) + putStr "Word16 : " >> print (map fromIntegral numbers :: [Word16]) + putStr "Word32 : " >> print (map fromIntegral numbers :: [Word32]) + putStr "Word64 : " >> print (map fromIntegral numbers :: [Word64]) + where numbers = [minBound, 0, maxBound] `asTypeOf` [zero] + +samples :: (Num a) => a -> [a] +samples zero = map fromInteger ([-3 .. -1]++[0 .. 3]) + +table1 :: (Show a, Show b) => String -> (a -> b) -> [a] -> IO () +table1 nm f xs = do + sequence [ f' x | x <- xs ] + putStrLn "#" + where + f' x = putStrLn (nm ++ " " ++ show x ++ " = " ++ show (f x)) + +table2 :: (Show a, Show b, Show c) => String -> (a -> b -> c) -> [a] -> [b] -> IO () +table2 nm op xs ys = do + sequence [ sequence [ op' x y | y <- ys ] >> putStrLn " " + | x <- xs + ] + putStrLn "#" + where + op' x y = do s <- Control.Exception.catch + (evaluate (show (op x y))) + (\e -> return (show (e :: SomeException))) + putStrLn (show x ++ " " ++ nm ++ " " ++ show y ++ " = " ++ s) + +testReadShow zero = do + putStrLn "testReadShow" + print xs + print (map read_show xs) + where + xs = samples zero + read_show x = (read (show x) `asTypeOf` zero) + +testEq zero = do + putStrLn "testEq" + table2 "==" (==) xs xs + table2 "/=" (/=) xs xs + where + xs = samples zero + +testOrd zero = do + putStrLn "testOrd" + table2 "<=" (<=) xs xs + table2 "< " (<) xs xs + table2 "> " (>) xs xs + table2 ">=" (>=) xs xs + table2 "`compare`" compare xs xs + where + xs = samples zero + +testNum zero = do + putStrLn "testNum" + table2 "+" (+) xs xs + table2 "-" (-) xs xs + table2 "*" (*) xs xs + table1 "negate" negate xs + where + xs = samples zero + +testReal zero = do + putStrLn "testReal" + table1 "toRational" toRational xs + where + xs = samples zero + +testIntegral zero = do + putStrLn "testIntegral" + table2 "`divMod` " divMod xs xs + table2 "`div` " div xs xs + table2 "`mod` " mod xs xs + table2 "`quotRem`" quotRem xs xs + table2 "`quot` " quot xs xs + table2 "`rem` " rem xs xs + where + xs = samples zero + +testBits zero do_bitsize = do + putStrLn "testBits" + table2 ".&. " (.&.) xs xs + table2 ".|. " (.|.) xs xs + table2 "`xor`" xor xs xs + table1 "complement" complement xs + table2 "`shiftL`" shiftL xs ([0..3] ++ [32,64]) + table2 "`shiftR`" shiftR xs ([0..3] ++ [32,64]) + table2 "`rotate`" rotate xs ([-3..3] ++ [-64,-32,32,64]) + table1 "bit" (\ x -> (bit x) `asTypeOf` zero) [(0::Int)..3] + table2 "`setBit`" setBit xs ([0..3] ++ [32,64]) + table2 "`clearBit`" clearBit xs ([0..3] ++ [32,64]) + table2 "`complementBit`" complementBit xs ([0..3] ++ [32,64]) + table2 "`testBit`" testBit xs ([0..3] ++ [32,64]) + if do_bitsize then table1 "bitSize" bitSize xs else return () + table1 "isSigned" isSigned xs + where + xs = samples zero diff --git a/testsuite/tests/numeric/should_run/arith011.stdout b/testsuite/tests/numeric/should_run/arith011.stdout new file mode 100644 index 0000000000..7404c4b353 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith011.stdout @@ -0,0 +1,15418 @@ +-------------------------------- +--Testing Int +-------------------------------- +testBounded +(2147483647,-2147483648,-2147483647) +(2147483646,2147483647,-2147483648) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-2147483648,0,2147483647] +Int : [-2147483648,0,2147483647] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [-2147483648,0,2147483647] +Int64 : [-2147483648,0,2147483647] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [2147483648,0,2147483647] +Word64 : [18446744071562067968,0,2147483647] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -1073741825 +-3 `rotate` -2 = 2147483647 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 +-3 `rotate` -64 = -3 +-3 `rotate` -32 = -3 +-3 `rotate` 32 = -3 +-3 `rotate` 64 = -3 + +-2 `rotate` -3 = -536870913 +-2 `rotate` -2 = -1073741825 +-2 `rotate` -1 = 2147483647 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 +-2 `rotate` -64 = -2 +-2 `rotate` -32 = -2 +-2 `rotate` 32 = -2 +-2 `rotate` 64 = -2 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -1 +-1 `rotate` 64 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 536870912 +1 `rotate` -2 = 1073741824 +1 `rotate` -1 = -2147483648 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 1073741824 +2 `rotate` -2 = -2147483648 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 1610612736 +3 `rotate` -2 = -1073741824 +3 `rotate` -1 = -2147483647 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 32 +bitSize -2 = 32 +bitSize -1 = 32 +bitSize 0 = 32 +bitSize 1 = 32 +bitSize 2 = 32 +bitSize 3 = 32 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int8 +-------------------------------- +testBounded +(127,-128,-127) +(126,127,-128) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-128,0,127] +Int : [-128,0,127] +Int8 : [-128,0,127] +Int16 : [-128,0,127] +Int32 : [-128,0,127] +Int64 : [-128,0,127] +Word8 : [128,0,127] +Word16 : [65408,0,127] +Word32 : [4294967168,0,127] +Word64 : [18446744073709551488,0,127] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -65 +-3 `rotate` -2 = 127 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 +-3 `rotate` -64 = -3 +-3 `rotate` -32 = -3 +-3 `rotate` 32 = -3 +-3 `rotate` 64 = -3 + +-2 `rotate` -3 = -33 +-2 `rotate` -2 = -65 +-2 `rotate` -1 = 127 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 +-2 `rotate` -64 = -2 +-2 `rotate` -32 = -2 +-2 `rotate` 32 = -2 +-2 `rotate` 64 = -2 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -1 +-1 `rotate` 64 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 32 +1 `rotate` -2 = 64 +1 `rotate` -1 = -128 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 64 +2 `rotate` -2 = -128 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 96 +3 `rotate` -2 = -64 +3 `rotate` -1 = -127 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 8 +bitSize -2 = 8 +bitSize -1 = 8 +bitSize 0 = 8 +bitSize 1 = 8 +bitSize 2 = 8 +bitSize 3 = 8 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int16 +-------------------------------- +testBounded +(32767,-32768,-32767) +(32766,32767,-32768) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-32768,0,32767] +Int : [-32768,0,32767] +Int8 : [0,0,-1] +Int16 : [-32768,0,32767] +Int32 : [-32768,0,32767] +Int64 : [-32768,0,32767] +Word8 : [0,0,255] +Word16 : [32768,0,32767] +Word32 : [4294934528,0,32767] +Word64 : [18446744073709518848,0,32767] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -16385 +-3 `rotate` -2 = 32767 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 +-3 `rotate` -64 = -3 +-3 `rotate` -32 = -3 +-3 `rotate` 32 = -3 +-3 `rotate` 64 = -3 + +-2 `rotate` -3 = -8193 +-2 `rotate` -2 = -16385 +-2 `rotate` -1 = 32767 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 +-2 `rotate` -64 = -2 +-2 `rotate` -32 = -2 +-2 `rotate` 32 = -2 +-2 `rotate` 64 = -2 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -1 +-1 `rotate` 64 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 8192 +1 `rotate` -2 = 16384 +1 `rotate` -1 = -32768 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 16384 +2 `rotate` -2 = -32768 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 24576 +3 `rotate` -2 = -16384 +3 `rotate` -1 = -32767 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 16 +bitSize -2 = 16 +bitSize -1 = 16 +bitSize 0 = 16 +bitSize 1 = 16 +bitSize 2 = 16 +bitSize 3 = 16 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int32 +-------------------------------- +testBounded +(2147483647,-2147483648,-2147483647) +(2147483646,2147483647,-2147483648) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-2147483648,0,2147483647] +Int : [-2147483648,0,2147483647] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [-2147483648,0,2147483647] +Int64 : [-2147483648,0,2147483647] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [2147483648,0,2147483647] +Word64 : [18446744071562067968,0,2147483647] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -1073741825 +-3 `rotate` -2 = 2147483647 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 +-3 `rotate` -64 = -3 +-3 `rotate` -32 = -3 +-3 `rotate` 32 = -3 +-3 `rotate` 64 = -3 + +-2 `rotate` -3 = -536870913 +-2 `rotate` -2 = -1073741825 +-2 `rotate` -1 = 2147483647 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 +-2 `rotate` -64 = -2 +-2 `rotate` -32 = -2 +-2 `rotate` 32 = -2 +-2 `rotate` 64 = -2 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -1 +-1 `rotate` 64 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 536870912 +1 `rotate` -2 = 1073741824 +1 `rotate` -1 = -2147483648 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 1073741824 +2 `rotate` -2 = -2147483648 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 1610612736 +3 `rotate` -2 = -1073741824 +3 `rotate` -1 = -2147483647 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 32 +bitSize -2 = 32 +bitSize -1 = 32 +bitSize 0 = 32 +bitSize 1 = 32 +bitSize 2 = 32 +bitSize 3 = 32 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int64 +-------------------------------- +testBounded +(9223372036854775807,-9223372036854775808,-9223372036854775807) +(9223372036854775806,9223372036854775807,-9223372036854775808) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-9223372036854775808,0,9223372036854775807] +Int : [0,0,-1] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [-9223372036854775808,0,9223372036854775807] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [9223372036854775808,0,9223372036854775807] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -4611686018427387905 +-3 `rotate` -2 = 9223372036854775807 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 +-3 `rotate` -64 = -3 +-3 `rotate` -32 = -8589934593 +-3 `rotate` 32 = -8589934593 +-3 `rotate` 64 = -3 + +-2 `rotate` -3 = -2305843009213693953 +-2 `rotate` -2 = -4611686018427387905 +-2 `rotate` -1 = 9223372036854775807 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 +-2 `rotate` -64 = -2 +-2 `rotate` -32 = -4294967297 +-2 `rotate` 32 = -4294967297 +-2 `rotate` 64 = -2 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -1 +-1 `rotate` 64 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = -9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 4294967296 +1 `rotate` 32 = 4294967296 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = -9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 8589934592 +2 `rotate` 32 = 8589934592 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = -4611686018427387904 +3 `rotate` -1 = -9223372036854775807 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 12884901888 +3 `rotate` 32 = 12884901888 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 64 +bitSize -2 = 64 +bitSize -1 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Word8 +-------------------------------- +testBounded +(255,0,1) +(254,255,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[253,254,255,0,1,2,3] +[253,254,255,0,1,2,3] +testEq +253 == 253 = True +253 == 254 = False +253 == 255 = False +253 == 0 = False +253 == 1 = False +253 == 2 = False +253 == 3 = False + +254 == 253 = False +254 == 254 = True +254 == 255 = False +254 == 0 = False +254 == 1 = False +254 == 2 = False +254 == 3 = False + +255 == 253 = False +255 == 254 = False +255 == 255 = True +255 == 0 = False +255 == 1 = False +255 == 2 = False +255 == 3 = False + +0 == 253 = False +0 == 254 = False +0 == 255 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 253 = False +1 == 254 = False +1 == 255 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 253 = False +2 == 254 = False +2 == 255 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 253 = False +3 == 254 = False +3 == 255 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +253 /= 253 = False +253 /= 254 = True +253 /= 255 = True +253 /= 0 = True +253 /= 1 = True +253 /= 2 = True +253 /= 3 = True + +254 /= 253 = True +254 /= 254 = False +254 /= 255 = True +254 /= 0 = True +254 /= 1 = True +254 /= 2 = True +254 /= 3 = True + +255 /= 253 = True +255 /= 254 = True +255 /= 255 = False +255 /= 0 = True +255 /= 1 = True +255 /= 2 = True +255 /= 3 = True + +0 /= 253 = True +0 /= 254 = True +0 /= 255 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 253 = True +1 /= 254 = True +1 /= 255 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 253 = True +2 /= 254 = True +2 /= 255 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 253 = True +3 /= 254 = True +3 /= 255 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +253 <= 253 = True +253 <= 254 = True +253 <= 255 = True +253 <= 0 = False +253 <= 1 = False +253 <= 2 = False +253 <= 3 = False + +254 <= 253 = False +254 <= 254 = True +254 <= 255 = True +254 <= 0 = False +254 <= 1 = False +254 <= 2 = False +254 <= 3 = False + +255 <= 253 = False +255 <= 254 = False +255 <= 255 = True +255 <= 0 = False +255 <= 1 = False +255 <= 2 = False +255 <= 3 = False + +0 <= 253 = True +0 <= 254 = True +0 <= 255 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 253 = True +1 <= 254 = True +1 <= 255 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 253 = True +2 <= 254 = True +2 <= 255 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 253 = True +3 <= 254 = True +3 <= 255 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +253 < 253 = False +253 < 254 = True +253 < 255 = True +253 < 0 = False +253 < 1 = False +253 < 2 = False +253 < 3 = False + +254 < 253 = False +254 < 254 = False +254 < 255 = True +254 < 0 = False +254 < 1 = False +254 < 2 = False +254 < 3 = False + +255 < 253 = False +255 < 254 = False +255 < 255 = False +255 < 0 = False +255 < 1 = False +255 < 2 = False +255 < 3 = False + +0 < 253 = True +0 < 254 = True +0 < 255 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 253 = True +1 < 254 = True +1 < 255 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 253 = True +2 < 254 = True +2 < 255 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 253 = True +3 < 254 = True +3 < 255 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +253 > 253 = False +253 > 254 = False +253 > 255 = False +253 > 0 = True +253 > 1 = True +253 > 2 = True +253 > 3 = True + +254 > 253 = True +254 > 254 = False +254 > 255 = False +254 > 0 = True +254 > 1 = True +254 > 2 = True +254 > 3 = True + +255 > 253 = True +255 > 254 = True +255 > 255 = False +255 > 0 = True +255 > 1 = True +255 > 2 = True +255 > 3 = True + +0 > 253 = False +0 > 254 = False +0 > 255 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 253 = False +1 > 254 = False +1 > 255 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 253 = False +2 > 254 = False +2 > 255 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 253 = False +3 > 254 = False +3 > 255 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +253 >= 253 = True +253 >= 254 = False +253 >= 255 = False +253 >= 0 = True +253 >= 1 = True +253 >= 2 = True +253 >= 3 = True + +254 >= 253 = True +254 >= 254 = True +254 >= 255 = False +254 >= 0 = True +254 >= 1 = True +254 >= 2 = True +254 >= 3 = True + +255 >= 253 = True +255 >= 254 = True +255 >= 255 = True +255 >= 0 = True +255 >= 1 = True +255 >= 2 = True +255 >= 3 = True + +0 >= 253 = False +0 >= 254 = False +0 >= 255 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 253 = False +1 >= 254 = False +1 >= 255 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 253 = False +2 >= 254 = False +2 >= 255 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 253 = False +3 >= 254 = False +3 >= 255 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +253 `compare` 253 = EQ +253 `compare` 254 = LT +253 `compare` 255 = LT +253 `compare` 0 = GT +253 `compare` 1 = GT +253 `compare` 2 = GT +253 `compare` 3 = GT + +254 `compare` 253 = GT +254 `compare` 254 = EQ +254 `compare` 255 = LT +254 `compare` 0 = GT +254 `compare` 1 = GT +254 `compare` 2 = GT +254 `compare` 3 = GT + +255 `compare` 253 = GT +255 `compare` 254 = GT +255 `compare` 255 = EQ +255 `compare` 0 = GT +255 `compare` 1 = GT +255 `compare` 2 = GT +255 `compare` 3 = GT + +0 `compare` 253 = LT +0 `compare` 254 = LT +0 `compare` 255 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 253 = LT +1 `compare` 254 = LT +1 `compare` 255 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 253 = LT +2 `compare` 254 = LT +2 `compare` 255 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 253 = LT +3 `compare` 254 = LT +3 `compare` 255 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +253 + 253 = 250 +253 + 254 = 251 +253 + 255 = 252 +253 + 0 = 253 +253 + 1 = 254 +253 + 2 = 255 +253 + 3 = 0 + +254 + 253 = 251 +254 + 254 = 252 +254 + 255 = 253 +254 + 0 = 254 +254 + 1 = 255 +254 + 2 = 0 +254 + 3 = 1 + +255 + 253 = 252 +255 + 254 = 253 +255 + 255 = 254 +255 + 0 = 255 +255 + 1 = 0 +255 + 2 = 1 +255 + 3 = 2 + +0 + 253 = 253 +0 + 254 = 254 +0 + 255 = 255 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 253 = 254 +1 + 254 = 255 +1 + 255 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 253 = 255 +2 + 254 = 0 +2 + 255 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 253 = 0 +3 + 254 = 1 +3 + 255 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +253 - 253 = 0 +253 - 254 = 255 +253 - 255 = 254 +253 - 0 = 253 +253 - 1 = 252 +253 - 2 = 251 +253 - 3 = 250 + +254 - 253 = 1 +254 - 254 = 0 +254 - 255 = 255 +254 - 0 = 254 +254 - 1 = 253 +254 - 2 = 252 +254 - 3 = 251 + +255 - 253 = 2 +255 - 254 = 1 +255 - 255 = 0 +255 - 0 = 255 +255 - 1 = 254 +255 - 2 = 253 +255 - 3 = 252 + +0 - 253 = 3 +0 - 254 = 2 +0 - 255 = 1 +0 - 0 = 0 +0 - 1 = 255 +0 - 2 = 254 +0 - 3 = 253 + +1 - 253 = 4 +1 - 254 = 3 +1 - 255 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 255 +1 - 3 = 254 + +2 - 253 = 5 +2 - 254 = 4 +2 - 255 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 255 + +3 - 253 = 6 +3 - 254 = 5 +3 - 255 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +253 * 253 = 9 +253 * 254 = 6 +253 * 255 = 3 +253 * 0 = 0 +253 * 1 = 253 +253 * 2 = 250 +253 * 3 = 247 + +254 * 253 = 6 +254 * 254 = 4 +254 * 255 = 2 +254 * 0 = 0 +254 * 1 = 254 +254 * 2 = 252 +254 * 3 = 250 + +255 * 253 = 3 +255 * 254 = 2 +255 * 255 = 1 +255 * 0 = 0 +255 * 1 = 255 +255 * 2 = 254 +255 * 3 = 253 + +0 * 253 = 0 +0 * 254 = 0 +0 * 255 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 253 = 253 +1 * 254 = 254 +1 * 255 = 255 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 253 = 250 +2 * 254 = 252 +2 * 255 = 254 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 253 = 247 +3 * 254 = 250 +3 * 255 = 253 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 253 = 3 +negate 254 = 2 +negate 255 = 1 +negate 0 = 0 +negate 1 = 255 +negate 2 = 254 +negate 3 = 253 +# +testReal +toRational 253 = 253 % 1 +toRational 254 = 254 % 1 +toRational 255 = 255 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +253 `divMod` 253 = (1,0) +253 `divMod` 254 = (0,253) +253 `divMod` 255 = (0,253) +253 `divMod` 0 = divide by zero +253 `divMod` 1 = (253,0) +253 `divMod` 2 = (126,1) +253 `divMod` 3 = (84,1) + +254 `divMod` 253 = (1,1) +254 `divMod` 254 = (1,0) +254 `divMod` 255 = (0,254) +254 `divMod` 0 = divide by zero +254 `divMod` 1 = (254,0) +254 `divMod` 2 = (127,0) +254 `divMod` 3 = (84,2) + +255 `divMod` 253 = (1,2) +255 `divMod` 254 = (1,1) +255 `divMod` 255 = (1,0) +255 `divMod` 0 = divide by zero +255 `divMod` 1 = (255,0) +255 `divMod` 2 = (127,1) +255 `divMod` 3 = (85,0) + +0 `divMod` 253 = (0,0) +0 `divMod` 254 = (0,0) +0 `divMod` 255 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 253 = (0,1) +1 `divMod` 254 = (0,1) +1 `divMod` 255 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 253 = (0,2) +2 `divMod` 254 = (0,2) +2 `divMod` 255 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 253 = (0,3) +3 `divMod` 254 = (0,3) +3 `divMod` 255 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +253 `div` 253 = 1 +253 `div` 254 = 0 +253 `div` 255 = 0 +253 `div` 0 = divide by zero +253 `div` 1 = 253 +253 `div` 2 = 126 +253 `div` 3 = 84 + +254 `div` 253 = 1 +254 `div` 254 = 1 +254 `div` 255 = 0 +254 `div` 0 = divide by zero +254 `div` 1 = 254 +254 `div` 2 = 127 +254 `div` 3 = 84 + +255 `div` 253 = 1 +255 `div` 254 = 1 +255 `div` 255 = 1 +255 `div` 0 = divide by zero +255 `div` 1 = 255 +255 `div` 2 = 127 +255 `div` 3 = 85 + +0 `div` 253 = 0 +0 `div` 254 = 0 +0 `div` 255 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 253 = 0 +1 `div` 254 = 0 +1 `div` 255 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 253 = 0 +2 `div` 254 = 0 +2 `div` 255 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 253 = 0 +3 `div` 254 = 0 +3 `div` 255 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +253 `mod` 253 = 0 +253 `mod` 254 = 253 +253 `mod` 255 = 253 +253 `mod` 0 = divide by zero +253 `mod` 1 = 0 +253 `mod` 2 = 1 +253 `mod` 3 = 1 + +254 `mod` 253 = 1 +254 `mod` 254 = 0 +254 `mod` 255 = 254 +254 `mod` 0 = divide by zero +254 `mod` 1 = 0 +254 `mod` 2 = 0 +254 `mod` 3 = 2 + +255 `mod` 253 = 2 +255 `mod` 254 = 1 +255 `mod` 255 = 0 +255 `mod` 0 = divide by zero +255 `mod` 1 = 0 +255 `mod` 2 = 1 +255 `mod` 3 = 0 + +0 `mod` 253 = 0 +0 `mod` 254 = 0 +0 `mod` 255 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 253 = 1 +1 `mod` 254 = 1 +1 `mod` 255 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 253 = 2 +2 `mod` 254 = 2 +2 `mod` 255 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 253 = 3 +3 `mod` 254 = 3 +3 `mod` 255 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +253 `quotRem` 253 = (1,0) +253 `quotRem` 254 = (0,253) +253 `quotRem` 255 = (0,253) +253 `quotRem` 0 = divide by zero +253 `quotRem` 1 = (253,0) +253 `quotRem` 2 = (126,1) +253 `quotRem` 3 = (84,1) + +254 `quotRem` 253 = (1,1) +254 `quotRem` 254 = (1,0) +254 `quotRem` 255 = (0,254) +254 `quotRem` 0 = divide by zero +254 `quotRem` 1 = (254,0) +254 `quotRem` 2 = (127,0) +254 `quotRem` 3 = (84,2) + +255 `quotRem` 253 = (1,2) +255 `quotRem` 254 = (1,1) +255 `quotRem` 255 = (1,0) +255 `quotRem` 0 = divide by zero +255 `quotRem` 1 = (255,0) +255 `quotRem` 2 = (127,1) +255 `quotRem` 3 = (85,0) + +0 `quotRem` 253 = (0,0) +0 `quotRem` 254 = (0,0) +0 `quotRem` 255 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 253 = (0,1) +1 `quotRem` 254 = (0,1) +1 `quotRem` 255 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 253 = (0,2) +2 `quotRem` 254 = (0,2) +2 `quotRem` 255 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 253 = (0,3) +3 `quotRem` 254 = (0,3) +3 `quotRem` 255 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +253 `quot` 253 = 1 +253 `quot` 254 = 0 +253 `quot` 255 = 0 +253 `quot` 0 = divide by zero +253 `quot` 1 = 253 +253 `quot` 2 = 126 +253 `quot` 3 = 84 + +254 `quot` 253 = 1 +254 `quot` 254 = 1 +254 `quot` 255 = 0 +254 `quot` 0 = divide by zero +254 `quot` 1 = 254 +254 `quot` 2 = 127 +254 `quot` 3 = 84 + +255 `quot` 253 = 1 +255 `quot` 254 = 1 +255 `quot` 255 = 1 +255 `quot` 0 = divide by zero +255 `quot` 1 = 255 +255 `quot` 2 = 127 +255 `quot` 3 = 85 + +0 `quot` 253 = 0 +0 `quot` 254 = 0 +0 `quot` 255 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 253 = 0 +1 `quot` 254 = 0 +1 `quot` 255 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 253 = 0 +2 `quot` 254 = 0 +2 `quot` 255 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 253 = 0 +3 `quot` 254 = 0 +3 `quot` 255 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +253 `rem` 253 = 0 +253 `rem` 254 = 253 +253 `rem` 255 = 253 +253 `rem` 0 = divide by zero +253 `rem` 1 = 0 +253 `rem` 2 = 1 +253 `rem` 3 = 1 + +254 `rem` 253 = 1 +254 `rem` 254 = 0 +254 `rem` 255 = 254 +254 `rem` 0 = divide by zero +254 `rem` 1 = 0 +254 `rem` 2 = 0 +254 `rem` 3 = 2 + +255 `rem` 253 = 2 +255 `rem` 254 = 1 +255 `rem` 255 = 0 +255 `rem` 0 = divide by zero +255 `rem` 1 = 0 +255 `rem` 2 = 1 +255 `rem` 3 = 0 + +0 `rem` 253 = 0 +0 `rem` 254 = 0 +0 `rem` 255 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 253 = 1 +1 `rem` 254 = 1 +1 `rem` 255 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 253 = 2 +2 `rem` 254 = 2 +2 `rem` 255 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 253 = 3 +3 `rem` 254 = 3 +3 `rem` 255 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,255] +Int : [0,0,255] +Int8 : [0,0,-1] +Int16 : [0,0,255] +Int32 : [0,0,255] +Int64 : [0,0,255] +Word8 : [0,0,255] +Word16 : [0,0,255] +Word32 : [0,0,255] +Word64 : [0,0,255] +testBits +253 .&. 253 = 253 +253 .&. 254 = 252 +253 .&. 255 = 253 +253 .&. 0 = 0 +253 .&. 1 = 1 +253 .&. 2 = 0 +253 .&. 3 = 1 + +254 .&. 253 = 252 +254 .&. 254 = 254 +254 .&. 255 = 254 +254 .&. 0 = 0 +254 .&. 1 = 0 +254 .&. 2 = 2 +254 .&. 3 = 2 + +255 .&. 253 = 253 +255 .&. 254 = 254 +255 .&. 255 = 255 +255 .&. 0 = 0 +255 .&. 1 = 1 +255 .&. 2 = 2 +255 .&. 3 = 3 + +0 .&. 253 = 0 +0 .&. 254 = 0 +0 .&. 255 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 253 = 1 +1 .&. 254 = 0 +1 .&. 255 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 253 = 0 +2 .&. 254 = 2 +2 .&. 255 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 253 = 1 +3 .&. 254 = 2 +3 .&. 255 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +253 .|. 253 = 253 +253 .|. 254 = 255 +253 .|. 255 = 255 +253 .|. 0 = 253 +253 .|. 1 = 253 +253 .|. 2 = 255 +253 .|. 3 = 255 + +254 .|. 253 = 255 +254 .|. 254 = 254 +254 .|. 255 = 255 +254 .|. 0 = 254 +254 .|. 1 = 255 +254 .|. 2 = 254 +254 .|. 3 = 255 + +255 .|. 253 = 255 +255 .|. 254 = 255 +255 .|. 255 = 255 +255 .|. 0 = 255 +255 .|. 1 = 255 +255 .|. 2 = 255 +255 .|. 3 = 255 + +0 .|. 253 = 253 +0 .|. 254 = 254 +0 .|. 255 = 255 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 253 = 253 +1 .|. 254 = 255 +1 .|. 255 = 255 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 253 = 255 +2 .|. 254 = 254 +2 .|. 255 = 255 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 253 = 255 +3 .|. 254 = 255 +3 .|. 255 = 255 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +253 `xor` 253 = 0 +253 `xor` 254 = 3 +253 `xor` 255 = 2 +253 `xor` 0 = 253 +253 `xor` 1 = 252 +253 `xor` 2 = 255 +253 `xor` 3 = 254 + +254 `xor` 253 = 3 +254 `xor` 254 = 0 +254 `xor` 255 = 1 +254 `xor` 0 = 254 +254 `xor` 1 = 255 +254 `xor` 2 = 252 +254 `xor` 3 = 253 + +255 `xor` 253 = 2 +255 `xor` 254 = 1 +255 `xor` 255 = 0 +255 `xor` 0 = 255 +255 `xor` 1 = 254 +255 `xor` 2 = 253 +255 `xor` 3 = 252 + +0 `xor` 253 = 253 +0 `xor` 254 = 254 +0 `xor` 255 = 255 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 253 = 252 +1 `xor` 254 = 255 +1 `xor` 255 = 254 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 253 = 255 +2 `xor` 254 = 252 +2 `xor` 255 = 253 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 253 = 254 +3 `xor` 254 = 253 +3 `xor` 255 = 252 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 253 = 2 +complement 254 = 1 +complement 255 = 0 +complement 0 = 255 +complement 1 = 254 +complement 2 = 253 +complement 3 = 252 +# +253 `shiftL` 0 = 253 +253 `shiftL` 1 = 250 +253 `shiftL` 2 = 244 +253 `shiftL` 3 = 232 +253 `shiftL` 32 = 0 +253 `shiftL` 64 = 0 + +254 `shiftL` 0 = 254 +254 `shiftL` 1 = 252 +254 `shiftL` 2 = 248 +254 `shiftL` 3 = 240 +254 `shiftL` 32 = 0 +254 `shiftL` 64 = 0 + +255 `shiftL` 0 = 255 +255 `shiftL` 1 = 254 +255 `shiftL` 2 = 252 +255 `shiftL` 3 = 248 +255 `shiftL` 32 = 0 +255 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +253 `shiftR` 0 = 253 +253 `shiftR` 1 = 126 +253 `shiftR` 2 = 63 +253 `shiftR` 3 = 31 +253 `shiftR` 32 = 0 +253 `shiftR` 64 = 0 + +254 `shiftR` 0 = 254 +254 `shiftR` 1 = 127 +254 `shiftR` 2 = 63 +254 `shiftR` 3 = 31 +254 `shiftR` 32 = 0 +254 `shiftR` 64 = 0 + +255 `shiftR` 0 = 255 +255 `shiftR` 1 = 127 +255 `shiftR` 2 = 63 +255 `shiftR` 3 = 31 +255 `shiftR` 32 = 0 +255 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +253 `rotate` -3 = 191 +253 `rotate` -2 = 127 +253 `rotate` -1 = 254 +253 `rotate` 0 = 253 +253 `rotate` 1 = 251 +253 `rotate` 2 = 247 +253 `rotate` 3 = 239 +253 `rotate` -64 = 253 +253 `rotate` -32 = 253 +253 `rotate` 32 = 253 +253 `rotate` 64 = 253 + +254 `rotate` -3 = 223 +254 `rotate` -2 = 191 +254 `rotate` -1 = 127 +254 `rotate` 0 = 254 +254 `rotate` 1 = 253 +254 `rotate` 2 = 251 +254 `rotate` 3 = 247 +254 `rotate` -64 = 254 +254 `rotate` -32 = 254 +254 `rotate` 32 = 254 +254 `rotate` 64 = 254 + +255 `rotate` -3 = 255 +255 `rotate` -2 = 255 +255 `rotate` -1 = 255 +255 `rotate` 0 = 255 +255 `rotate` 1 = 255 +255 `rotate` 2 = 255 +255 `rotate` 3 = 255 +255 `rotate` -64 = 255 +255 `rotate` -32 = 255 +255 `rotate` 32 = 255 +255 `rotate` 64 = 255 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 32 +1 `rotate` -2 = 64 +1 `rotate` -1 = 128 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 64 +2 `rotate` -2 = 128 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 96 +3 `rotate` -2 = 192 +3 `rotate` -1 = 129 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +253 `setBit` 0 = 253 +253 `setBit` 1 = 255 +253 `setBit` 2 = 253 +253 `setBit` 3 = 253 +253 `setBit` 32 = 253 +253 `setBit` 64 = 253 + +254 `setBit` 0 = 255 +254 `setBit` 1 = 254 +254 `setBit` 2 = 254 +254 `setBit` 3 = 254 +254 `setBit` 32 = 254 +254 `setBit` 64 = 254 + +255 `setBit` 0 = 255 +255 `setBit` 1 = 255 +255 `setBit` 2 = 255 +255 `setBit` 3 = 255 +255 `setBit` 32 = 255 +255 `setBit` 64 = 255 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +253 `clearBit` 0 = 252 +253 `clearBit` 1 = 253 +253 `clearBit` 2 = 249 +253 `clearBit` 3 = 245 +253 `clearBit` 32 = 253 +253 `clearBit` 64 = 253 + +254 `clearBit` 0 = 254 +254 `clearBit` 1 = 252 +254 `clearBit` 2 = 250 +254 `clearBit` 3 = 246 +254 `clearBit` 32 = 254 +254 `clearBit` 64 = 254 + +255 `clearBit` 0 = 254 +255 `clearBit` 1 = 253 +255 `clearBit` 2 = 251 +255 `clearBit` 3 = 247 +255 `clearBit` 32 = 255 +255 `clearBit` 64 = 255 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +253 `complementBit` 0 = 252 +253 `complementBit` 1 = 255 +253 `complementBit` 2 = 249 +253 `complementBit` 3 = 245 +253 `complementBit` 32 = 253 +253 `complementBit` 64 = 253 + +254 `complementBit` 0 = 255 +254 `complementBit` 1 = 252 +254 `complementBit` 2 = 250 +254 `complementBit` 3 = 246 +254 `complementBit` 32 = 254 +254 `complementBit` 64 = 254 + +255 `complementBit` 0 = 254 +255 `complementBit` 1 = 253 +255 `complementBit` 2 = 251 +255 `complementBit` 3 = 247 +255 `complementBit` 32 = 255 +255 `complementBit` 64 = 255 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +253 `testBit` 0 = True +253 `testBit` 1 = False +253 `testBit` 2 = True +253 `testBit` 3 = True +253 `testBit` 32 = False +253 `testBit` 64 = False + +254 `testBit` 0 = False +254 `testBit` 1 = True +254 `testBit` 2 = True +254 `testBit` 3 = True +254 `testBit` 32 = False +254 `testBit` 64 = False + +255 `testBit` 0 = True +255 `testBit` 1 = True +255 `testBit` 2 = True +255 `testBit` 3 = True +255 `testBit` 32 = False +255 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 253 = 8 +bitSize 254 = 8 +bitSize 255 = 8 +bitSize 0 = 8 +bitSize 1 = 8 +bitSize 2 = 8 +bitSize 3 = 8 +# +isSigned 253 = False +isSigned 254 = False +isSigned 255 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word16 +-------------------------------- +testBounded +(65535,0,1) +(65534,65535,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[65533,65534,65535,0,1,2,3] +[65533,65534,65535,0,1,2,3] +testEq +65533 == 65533 = True +65533 == 65534 = False +65533 == 65535 = False +65533 == 0 = False +65533 == 1 = False +65533 == 2 = False +65533 == 3 = False + +65534 == 65533 = False +65534 == 65534 = True +65534 == 65535 = False +65534 == 0 = False +65534 == 1 = False +65534 == 2 = False +65534 == 3 = False + +65535 == 65533 = False +65535 == 65534 = False +65535 == 65535 = True +65535 == 0 = False +65535 == 1 = False +65535 == 2 = False +65535 == 3 = False + +0 == 65533 = False +0 == 65534 = False +0 == 65535 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 65533 = False +1 == 65534 = False +1 == 65535 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 65533 = False +2 == 65534 = False +2 == 65535 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 65533 = False +3 == 65534 = False +3 == 65535 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +65533 /= 65533 = False +65533 /= 65534 = True +65533 /= 65535 = True +65533 /= 0 = True +65533 /= 1 = True +65533 /= 2 = True +65533 /= 3 = True + +65534 /= 65533 = True +65534 /= 65534 = False +65534 /= 65535 = True +65534 /= 0 = True +65534 /= 1 = True +65534 /= 2 = True +65534 /= 3 = True + +65535 /= 65533 = True +65535 /= 65534 = True +65535 /= 65535 = False +65535 /= 0 = True +65535 /= 1 = True +65535 /= 2 = True +65535 /= 3 = True + +0 /= 65533 = True +0 /= 65534 = True +0 /= 65535 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 65533 = True +1 /= 65534 = True +1 /= 65535 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 65533 = True +2 /= 65534 = True +2 /= 65535 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 65533 = True +3 /= 65534 = True +3 /= 65535 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +65533 <= 65533 = True +65533 <= 65534 = True +65533 <= 65535 = True +65533 <= 0 = False +65533 <= 1 = False +65533 <= 2 = False +65533 <= 3 = False + +65534 <= 65533 = False +65534 <= 65534 = True +65534 <= 65535 = True +65534 <= 0 = False +65534 <= 1 = False +65534 <= 2 = False +65534 <= 3 = False + +65535 <= 65533 = False +65535 <= 65534 = False +65535 <= 65535 = True +65535 <= 0 = False +65535 <= 1 = False +65535 <= 2 = False +65535 <= 3 = False + +0 <= 65533 = True +0 <= 65534 = True +0 <= 65535 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 65533 = True +1 <= 65534 = True +1 <= 65535 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 65533 = True +2 <= 65534 = True +2 <= 65535 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 65533 = True +3 <= 65534 = True +3 <= 65535 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +65533 < 65533 = False +65533 < 65534 = True +65533 < 65535 = True +65533 < 0 = False +65533 < 1 = False +65533 < 2 = False +65533 < 3 = False + +65534 < 65533 = False +65534 < 65534 = False +65534 < 65535 = True +65534 < 0 = False +65534 < 1 = False +65534 < 2 = False +65534 < 3 = False + +65535 < 65533 = False +65535 < 65534 = False +65535 < 65535 = False +65535 < 0 = False +65535 < 1 = False +65535 < 2 = False +65535 < 3 = False + +0 < 65533 = True +0 < 65534 = True +0 < 65535 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 65533 = True +1 < 65534 = True +1 < 65535 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 65533 = True +2 < 65534 = True +2 < 65535 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 65533 = True +3 < 65534 = True +3 < 65535 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +65533 > 65533 = False +65533 > 65534 = False +65533 > 65535 = False +65533 > 0 = True +65533 > 1 = True +65533 > 2 = True +65533 > 3 = True + +65534 > 65533 = True +65534 > 65534 = False +65534 > 65535 = False +65534 > 0 = True +65534 > 1 = True +65534 > 2 = True +65534 > 3 = True + +65535 > 65533 = True +65535 > 65534 = True +65535 > 65535 = False +65535 > 0 = True +65535 > 1 = True +65535 > 2 = True +65535 > 3 = True + +0 > 65533 = False +0 > 65534 = False +0 > 65535 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 65533 = False +1 > 65534 = False +1 > 65535 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 65533 = False +2 > 65534 = False +2 > 65535 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 65533 = False +3 > 65534 = False +3 > 65535 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +65533 >= 65533 = True +65533 >= 65534 = False +65533 >= 65535 = False +65533 >= 0 = True +65533 >= 1 = True +65533 >= 2 = True +65533 >= 3 = True + +65534 >= 65533 = True +65534 >= 65534 = True +65534 >= 65535 = False +65534 >= 0 = True +65534 >= 1 = True +65534 >= 2 = True +65534 >= 3 = True + +65535 >= 65533 = True +65535 >= 65534 = True +65535 >= 65535 = True +65535 >= 0 = True +65535 >= 1 = True +65535 >= 2 = True +65535 >= 3 = True + +0 >= 65533 = False +0 >= 65534 = False +0 >= 65535 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 65533 = False +1 >= 65534 = False +1 >= 65535 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 65533 = False +2 >= 65534 = False +2 >= 65535 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 65533 = False +3 >= 65534 = False +3 >= 65535 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +65533 `compare` 65533 = EQ +65533 `compare` 65534 = LT +65533 `compare` 65535 = LT +65533 `compare` 0 = GT +65533 `compare` 1 = GT +65533 `compare` 2 = GT +65533 `compare` 3 = GT + +65534 `compare` 65533 = GT +65534 `compare` 65534 = EQ +65534 `compare` 65535 = LT +65534 `compare` 0 = GT +65534 `compare` 1 = GT +65534 `compare` 2 = GT +65534 `compare` 3 = GT + +65535 `compare` 65533 = GT +65535 `compare` 65534 = GT +65535 `compare` 65535 = EQ +65535 `compare` 0 = GT +65535 `compare` 1 = GT +65535 `compare` 2 = GT +65535 `compare` 3 = GT + +0 `compare` 65533 = LT +0 `compare` 65534 = LT +0 `compare` 65535 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 65533 = LT +1 `compare` 65534 = LT +1 `compare` 65535 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 65533 = LT +2 `compare` 65534 = LT +2 `compare` 65535 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 65533 = LT +3 `compare` 65534 = LT +3 `compare` 65535 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +65533 + 65533 = 65530 +65533 + 65534 = 65531 +65533 + 65535 = 65532 +65533 + 0 = 65533 +65533 + 1 = 65534 +65533 + 2 = 65535 +65533 + 3 = 0 + +65534 + 65533 = 65531 +65534 + 65534 = 65532 +65534 + 65535 = 65533 +65534 + 0 = 65534 +65534 + 1 = 65535 +65534 + 2 = 0 +65534 + 3 = 1 + +65535 + 65533 = 65532 +65535 + 65534 = 65533 +65535 + 65535 = 65534 +65535 + 0 = 65535 +65535 + 1 = 0 +65535 + 2 = 1 +65535 + 3 = 2 + +0 + 65533 = 65533 +0 + 65534 = 65534 +0 + 65535 = 65535 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 65533 = 65534 +1 + 65534 = 65535 +1 + 65535 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 65533 = 65535 +2 + 65534 = 0 +2 + 65535 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 65533 = 0 +3 + 65534 = 1 +3 + 65535 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +65533 - 65533 = 0 +65533 - 65534 = 65535 +65533 - 65535 = 65534 +65533 - 0 = 65533 +65533 - 1 = 65532 +65533 - 2 = 65531 +65533 - 3 = 65530 + +65534 - 65533 = 1 +65534 - 65534 = 0 +65534 - 65535 = 65535 +65534 - 0 = 65534 +65534 - 1 = 65533 +65534 - 2 = 65532 +65534 - 3 = 65531 + +65535 - 65533 = 2 +65535 - 65534 = 1 +65535 - 65535 = 0 +65535 - 0 = 65535 +65535 - 1 = 65534 +65535 - 2 = 65533 +65535 - 3 = 65532 + +0 - 65533 = 3 +0 - 65534 = 2 +0 - 65535 = 1 +0 - 0 = 0 +0 - 1 = 65535 +0 - 2 = 65534 +0 - 3 = 65533 + +1 - 65533 = 4 +1 - 65534 = 3 +1 - 65535 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 65535 +1 - 3 = 65534 + +2 - 65533 = 5 +2 - 65534 = 4 +2 - 65535 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 65535 + +3 - 65533 = 6 +3 - 65534 = 5 +3 - 65535 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +65533 * 65533 = 9 +65533 * 65534 = 6 +65533 * 65535 = 3 +65533 * 0 = 0 +65533 * 1 = 65533 +65533 * 2 = 65530 +65533 * 3 = 65527 + +65534 * 65533 = 6 +65534 * 65534 = 4 +65534 * 65535 = 2 +65534 * 0 = 0 +65534 * 1 = 65534 +65534 * 2 = 65532 +65534 * 3 = 65530 + +65535 * 65533 = 3 +65535 * 65534 = 2 +65535 * 65535 = 1 +65535 * 0 = 0 +65535 * 1 = 65535 +65535 * 2 = 65534 +65535 * 3 = 65533 + +0 * 65533 = 0 +0 * 65534 = 0 +0 * 65535 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 65533 = 65533 +1 * 65534 = 65534 +1 * 65535 = 65535 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 65533 = 65530 +2 * 65534 = 65532 +2 * 65535 = 65534 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 65533 = 65527 +3 * 65534 = 65530 +3 * 65535 = 65533 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 65533 = 3 +negate 65534 = 2 +negate 65535 = 1 +negate 0 = 0 +negate 1 = 65535 +negate 2 = 65534 +negate 3 = 65533 +# +testReal +toRational 65533 = 65533 % 1 +toRational 65534 = 65534 % 1 +toRational 65535 = 65535 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +65533 `divMod` 65533 = (1,0) +65533 `divMod` 65534 = (0,65533) +65533 `divMod` 65535 = (0,65533) +65533 `divMod` 0 = divide by zero +65533 `divMod` 1 = (65533,0) +65533 `divMod` 2 = (32766,1) +65533 `divMod` 3 = (21844,1) + +65534 `divMod` 65533 = (1,1) +65534 `divMod` 65534 = (1,0) +65534 `divMod` 65535 = (0,65534) +65534 `divMod` 0 = divide by zero +65534 `divMod` 1 = (65534,0) +65534 `divMod` 2 = (32767,0) +65534 `divMod` 3 = (21844,2) + +65535 `divMod` 65533 = (1,2) +65535 `divMod` 65534 = (1,1) +65535 `divMod` 65535 = (1,0) +65535 `divMod` 0 = divide by zero +65535 `divMod` 1 = (65535,0) +65535 `divMod` 2 = (32767,1) +65535 `divMod` 3 = (21845,0) + +0 `divMod` 65533 = (0,0) +0 `divMod` 65534 = (0,0) +0 `divMod` 65535 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 65533 = (0,1) +1 `divMod` 65534 = (0,1) +1 `divMod` 65535 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 65533 = (0,2) +2 `divMod` 65534 = (0,2) +2 `divMod` 65535 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 65533 = (0,3) +3 `divMod` 65534 = (0,3) +3 `divMod` 65535 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +65533 `div` 65533 = 1 +65533 `div` 65534 = 0 +65533 `div` 65535 = 0 +65533 `div` 0 = divide by zero +65533 `div` 1 = 65533 +65533 `div` 2 = 32766 +65533 `div` 3 = 21844 + +65534 `div` 65533 = 1 +65534 `div` 65534 = 1 +65534 `div` 65535 = 0 +65534 `div` 0 = divide by zero +65534 `div` 1 = 65534 +65534 `div` 2 = 32767 +65534 `div` 3 = 21844 + +65535 `div` 65533 = 1 +65535 `div` 65534 = 1 +65535 `div` 65535 = 1 +65535 `div` 0 = divide by zero +65535 `div` 1 = 65535 +65535 `div` 2 = 32767 +65535 `div` 3 = 21845 + +0 `div` 65533 = 0 +0 `div` 65534 = 0 +0 `div` 65535 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 65533 = 0 +1 `div` 65534 = 0 +1 `div` 65535 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 65533 = 0 +2 `div` 65534 = 0 +2 `div` 65535 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 65533 = 0 +3 `div` 65534 = 0 +3 `div` 65535 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +65533 `mod` 65533 = 0 +65533 `mod` 65534 = 65533 +65533 `mod` 65535 = 65533 +65533 `mod` 0 = divide by zero +65533 `mod` 1 = 0 +65533 `mod` 2 = 1 +65533 `mod` 3 = 1 + +65534 `mod` 65533 = 1 +65534 `mod` 65534 = 0 +65534 `mod` 65535 = 65534 +65534 `mod` 0 = divide by zero +65534 `mod` 1 = 0 +65534 `mod` 2 = 0 +65534 `mod` 3 = 2 + +65535 `mod` 65533 = 2 +65535 `mod` 65534 = 1 +65535 `mod` 65535 = 0 +65535 `mod` 0 = divide by zero +65535 `mod` 1 = 0 +65535 `mod` 2 = 1 +65535 `mod` 3 = 0 + +0 `mod` 65533 = 0 +0 `mod` 65534 = 0 +0 `mod` 65535 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 65533 = 1 +1 `mod` 65534 = 1 +1 `mod` 65535 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 65533 = 2 +2 `mod` 65534 = 2 +2 `mod` 65535 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 65533 = 3 +3 `mod` 65534 = 3 +3 `mod` 65535 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +65533 `quotRem` 65533 = (1,0) +65533 `quotRem` 65534 = (0,65533) +65533 `quotRem` 65535 = (0,65533) +65533 `quotRem` 0 = divide by zero +65533 `quotRem` 1 = (65533,0) +65533 `quotRem` 2 = (32766,1) +65533 `quotRem` 3 = (21844,1) + +65534 `quotRem` 65533 = (1,1) +65534 `quotRem` 65534 = (1,0) +65534 `quotRem` 65535 = (0,65534) +65534 `quotRem` 0 = divide by zero +65534 `quotRem` 1 = (65534,0) +65534 `quotRem` 2 = (32767,0) +65534 `quotRem` 3 = (21844,2) + +65535 `quotRem` 65533 = (1,2) +65535 `quotRem` 65534 = (1,1) +65535 `quotRem` 65535 = (1,0) +65535 `quotRem` 0 = divide by zero +65535 `quotRem` 1 = (65535,0) +65535 `quotRem` 2 = (32767,1) +65535 `quotRem` 3 = (21845,0) + +0 `quotRem` 65533 = (0,0) +0 `quotRem` 65534 = (0,0) +0 `quotRem` 65535 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 65533 = (0,1) +1 `quotRem` 65534 = (0,1) +1 `quotRem` 65535 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 65533 = (0,2) +2 `quotRem` 65534 = (0,2) +2 `quotRem` 65535 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 65533 = (0,3) +3 `quotRem` 65534 = (0,3) +3 `quotRem` 65535 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +65533 `quot` 65533 = 1 +65533 `quot` 65534 = 0 +65533 `quot` 65535 = 0 +65533 `quot` 0 = divide by zero +65533 `quot` 1 = 65533 +65533 `quot` 2 = 32766 +65533 `quot` 3 = 21844 + +65534 `quot` 65533 = 1 +65534 `quot` 65534 = 1 +65534 `quot` 65535 = 0 +65534 `quot` 0 = divide by zero +65534 `quot` 1 = 65534 +65534 `quot` 2 = 32767 +65534 `quot` 3 = 21844 + +65535 `quot` 65533 = 1 +65535 `quot` 65534 = 1 +65535 `quot` 65535 = 1 +65535 `quot` 0 = divide by zero +65535 `quot` 1 = 65535 +65535 `quot` 2 = 32767 +65535 `quot` 3 = 21845 + +0 `quot` 65533 = 0 +0 `quot` 65534 = 0 +0 `quot` 65535 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 65533 = 0 +1 `quot` 65534 = 0 +1 `quot` 65535 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 65533 = 0 +2 `quot` 65534 = 0 +2 `quot` 65535 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 65533 = 0 +3 `quot` 65534 = 0 +3 `quot` 65535 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +65533 `rem` 65533 = 0 +65533 `rem` 65534 = 65533 +65533 `rem` 65535 = 65533 +65533 `rem` 0 = divide by zero +65533 `rem` 1 = 0 +65533 `rem` 2 = 1 +65533 `rem` 3 = 1 + +65534 `rem` 65533 = 1 +65534 `rem` 65534 = 0 +65534 `rem` 65535 = 65534 +65534 `rem` 0 = divide by zero +65534 `rem` 1 = 0 +65534 `rem` 2 = 0 +65534 `rem` 3 = 2 + +65535 `rem` 65533 = 2 +65535 `rem` 65534 = 1 +65535 `rem` 65535 = 0 +65535 `rem` 0 = divide by zero +65535 `rem` 1 = 0 +65535 `rem` 2 = 1 +65535 `rem` 3 = 0 + +0 `rem` 65533 = 0 +0 `rem` 65534 = 0 +0 `rem` 65535 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 65533 = 1 +1 `rem` 65534 = 1 +1 `rem` 65535 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 65533 = 2 +2 `rem` 65534 = 2 +2 `rem` 65535 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 65533 = 3 +3 `rem` 65534 = 3 +3 `rem` 65535 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,65535] +Int : [0,0,65535] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,65535] +Int64 : [0,0,65535] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,65535] +Word64 : [0,0,65535] +testBits +65533 .&. 65533 = 65533 +65533 .&. 65534 = 65532 +65533 .&. 65535 = 65533 +65533 .&. 0 = 0 +65533 .&. 1 = 1 +65533 .&. 2 = 0 +65533 .&. 3 = 1 + +65534 .&. 65533 = 65532 +65534 .&. 65534 = 65534 +65534 .&. 65535 = 65534 +65534 .&. 0 = 0 +65534 .&. 1 = 0 +65534 .&. 2 = 2 +65534 .&. 3 = 2 + +65535 .&. 65533 = 65533 +65535 .&. 65534 = 65534 +65535 .&. 65535 = 65535 +65535 .&. 0 = 0 +65535 .&. 1 = 1 +65535 .&. 2 = 2 +65535 .&. 3 = 3 + +0 .&. 65533 = 0 +0 .&. 65534 = 0 +0 .&. 65535 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 65533 = 1 +1 .&. 65534 = 0 +1 .&. 65535 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 65533 = 0 +2 .&. 65534 = 2 +2 .&. 65535 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 65533 = 1 +3 .&. 65534 = 2 +3 .&. 65535 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +65533 .|. 65533 = 65533 +65533 .|. 65534 = 65535 +65533 .|. 65535 = 65535 +65533 .|. 0 = 65533 +65533 .|. 1 = 65533 +65533 .|. 2 = 65535 +65533 .|. 3 = 65535 + +65534 .|. 65533 = 65535 +65534 .|. 65534 = 65534 +65534 .|. 65535 = 65535 +65534 .|. 0 = 65534 +65534 .|. 1 = 65535 +65534 .|. 2 = 65534 +65534 .|. 3 = 65535 + +65535 .|. 65533 = 65535 +65535 .|. 65534 = 65535 +65535 .|. 65535 = 65535 +65535 .|. 0 = 65535 +65535 .|. 1 = 65535 +65535 .|. 2 = 65535 +65535 .|. 3 = 65535 + +0 .|. 65533 = 65533 +0 .|. 65534 = 65534 +0 .|. 65535 = 65535 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 65533 = 65533 +1 .|. 65534 = 65535 +1 .|. 65535 = 65535 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 65533 = 65535 +2 .|. 65534 = 65534 +2 .|. 65535 = 65535 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 65533 = 65535 +3 .|. 65534 = 65535 +3 .|. 65535 = 65535 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +65533 `xor` 65533 = 0 +65533 `xor` 65534 = 3 +65533 `xor` 65535 = 2 +65533 `xor` 0 = 65533 +65533 `xor` 1 = 65532 +65533 `xor` 2 = 65535 +65533 `xor` 3 = 65534 + +65534 `xor` 65533 = 3 +65534 `xor` 65534 = 0 +65534 `xor` 65535 = 1 +65534 `xor` 0 = 65534 +65534 `xor` 1 = 65535 +65534 `xor` 2 = 65532 +65534 `xor` 3 = 65533 + +65535 `xor` 65533 = 2 +65535 `xor` 65534 = 1 +65535 `xor` 65535 = 0 +65535 `xor` 0 = 65535 +65535 `xor` 1 = 65534 +65535 `xor` 2 = 65533 +65535 `xor` 3 = 65532 + +0 `xor` 65533 = 65533 +0 `xor` 65534 = 65534 +0 `xor` 65535 = 65535 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 65533 = 65532 +1 `xor` 65534 = 65535 +1 `xor` 65535 = 65534 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 65533 = 65535 +2 `xor` 65534 = 65532 +2 `xor` 65535 = 65533 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 65533 = 65534 +3 `xor` 65534 = 65533 +3 `xor` 65535 = 65532 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 65533 = 2 +complement 65534 = 1 +complement 65535 = 0 +complement 0 = 65535 +complement 1 = 65534 +complement 2 = 65533 +complement 3 = 65532 +# +65533 `shiftL` 0 = 65533 +65533 `shiftL` 1 = 65530 +65533 `shiftL` 2 = 65524 +65533 `shiftL` 3 = 65512 +65533 `shiftL` 32 = 0 +65533 `shiftL` 64 = 0 + +65534 `shiftL` 0 = 65534 +65534 `shiftL` 1 = 65532 +65534 `shiftL` 2 = 65528 +65534 `shiftL` 3 = 65520 +65534 `shiftL` 32 = 0 +65534 `shiftL` 64 = 0 + +65535 `shiftL` 0 = 65535 +65535 `shiftL` 1 = 65534 +65535 `shiftL` 2 = 65532 +65535 `shiftL` 3 = 65528 +65535 `shiftL` 32 = 0 +65535 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +65533 `shiftR` 0 = 65533 +65533 `shiftR` 1 = 32766 +65533 `shiftR` 2 = 16383 +65533 `shiftR` 3 = 8191 +65533 `shiftR` 32 = 0 +65533 `shiftR` 64 = 0 + +65534 `shiftR` 0 = 65534 +65534 `shiftR` 1 = 32767 +65534 `shiftR` 2 = 16383 +65534 `shiftR` 3 = 8191 +65534 `shiftR` 32 = 0 +65534 `shiftR` 64 = 0 + +65535 `shiftR` 0 = 65535 +65535 `shiftR` 1 = 32767 +65535 `shiftR` 2 = 16383 +65535 `shiftR` 3 = 8191 +65535 `shiftR` 32 = 0 +65535 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +65533 `rotate` -3 = 49151 +65533 `rotate` -2 = 32767 +65533 `rotate` -1 = 65534 +65533 `rotate` 0 = 65533 +65533 `rotate` 1 = 65531 +65533 `rotate` 2 = 65527 +65533 `rotate` 3 = 65519 +65533 `rotate` -64 = 65533 +65533 `rotate` -32 = 65533 +65533 `rotate` 32 = 65533 +65533 `rotate` 64 = 65533 + +65534 `rotate` -3 = 57343 +65534 `rotate` -2 = 49151 +65534 `rotate` -1 = 32767 +65534 `rotate` 0 = 65534 +65534 `rotate` 1 = 65533 +65534 `rotate` 2 = 65531 +65534 `rotate` 3 = 65527 +65534 `rotate` -64 = 65534 +65534 `rotate` -32 = 65534 +65534 `rotate` 32 = 65534 +65534 `rotate` 64 = 65534 + +65535 `rotate` -3 = 65535 +65535 `rotate` -2 = 65535 +65535 `rotate` -1 = 65535 +65535 `rotate` 0 = 65535 +65535 `rotate` 1 = 65535 +65535 `rotate` 2 = 65535 +65535 `rotate` 3 = 65535 +65535 `rotate` -64 = 65535 +65535 `rotate` -32 = 65535 +65535 `rotate` 32 = 65535 +65535 `rotate` 64 = 65535 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 8192 +1 `rotate` -2 = 16384 +1 `rotate` -1 = 32768 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 16384 +2 `rotate` -2 = 32768 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 24576 +3 `rotate` -2 = 49152 +3 `rotate` -1 = 32769 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +65533 `setBit` 0 = 65533 +65533 `setBit` 1 = 65535 +65533 `setBit` 2 = 65533 +65533 `setBit` 3 = 65533 +65533 `setBit` 32 = 65533 +65533 `setBit` 64 = 65533 + +65534 `setBit` 0 = 65535 +65534 `setBit` 1 = 65534 +65534 `setBit` 2 = 65534 +65534 `setBit` 3 = 65534 +65534 `setBit` 32 = 65534 +65534 `setBit` 64 = 65534 + +65535 `setBit` 0 = 65535 +65535 `setBit` 1 = 65535 +65535 `setBit` 2 = 65535 +65535 `setBit` 3 = 65535 +65535 `setBit` 32 = 65535 +65535 `setBit` 64 = 65535 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +65533 `clearBit` 0 = 65532 +65533 `clearBit` 1 = 65533 +65533 `clearBit` 2 = 65529 +65533 `clearBit` 3 = 65525 +65533 `clearBit` 32 = 65533 +65533 `clearBit` 64 = 65533 + +65534 `clearBit` 0 = 65534 +65534 `clearBit` 1 = 65532 +65534 `clearBit` 2 = 65530 +65534 `clearBit` 3 = 65526 +65534 `clearBit` 32 = 65534 +65534 `clearBit` 64 = 65534 + +65535 `clearBit` 0 = 65534 +65535 `clearBit` 1 = 65533 +65535 `clearBit` 2 = 65531 +65535 `clearBit` 3 = 65527 +65535 `clearBit` 32 = 65535 +65535 `clearBit` 64 = 65535 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +65533 `complementBit` 0 = 65532 +65533 `complementBit` 1 = 65535 +65533 `complementBit` 2 = 65529 +65533 `complementBit` 3 = 65525 +65533 `complementBit` 32 = 65533 +65533 `complementBit` 64 = 65533 + +65534 `complementBit` 0 = 65535 +65534 `complementBit` 1 = 65532 +65534 `complementBit` 2 = 65530 +65534 `complementBit` 3 = 65526 +65534 `complementBit` 32 = 65534 +65534 `complementBit` 64 = 65534 + +65535 `complementBit` 0 = 65534 +65535 `complementBit` 1 = 65533 +65535 `complementBit` 2 = 65531 +65535 `complementBit` 3 = 65527 +65535 `complementBit` 32 = 65535 +65535 `complementBit` 64 = 65535 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +65533 `testBit` 0 = True +65533 `testBit` 1 = False +65533 `testBit` 2 = True +65533 `testBit` 3 = True +65533 `testBit` 32 = False +65533 `testBit` 64 = False + +65534 `testBit` 0 = False +65534 `testBit` 1 = True +65534 `testBit` 2 = True +65534 `testBit` 3 = True +65534 `testBit` 32 = False +65534 `testBit` 64 = False + +65535 `testBit` 0 = True +65535 `testBit` 1 = True +65535 `testBit` 2 = True +65535 `testBit` 3 = True +65535 `testBit` 32 = False +65535 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 65533 = 16 +bitSize 65534 = 16 +bitSize 65535 = 16 +bitSize 0 = 16 +bitSize 1 = 16 +bitSize 2 = 16 +bitSize 3 = 16 +# +isSigned 65533 = False +isSigned 65534 = False +isSigned 65535 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word32 +-------------------------------- +testBounded +(4294967295,0,1) +(4294967294,4294967295,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[4294967293,4294967294,4294967295,0,1,2,3] +[4294967293,4294967294,4294967295,0,1,2,3] +testEq +4294967293 == 4294967293 = True +4294967293 == 4294967294 = False +4294967293 == 4294967295 = False +4294967293 == 0 = False +4294967293 == 1 = False +4294967293 == 2 = False +4294967293 == 3 = False + +4294967294 == 4294967293 = False +4294967294 == 4294967294 = True +4294967294 == 4294967295 = False +4294967294 == 0 = False +4294967294 == 1 = False +4294967294 == 2 = False +4294967294 == 3 = False + +4294967295 == 4294967293 = False +4294967295 == 4294967294 = False +4294967295 == 4294967295 = True +4294967295 == 0 = False +4294967295 == 1 = False +4294967295 == 2 = False +4294967295 == 3 = False + +0 == 4294967293 = False +0 == 4294967294 = False +0 == 4294967295 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 4294967293 = False +1 == 4294967294 = False +1 == 4294967295 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 4294967293 = False +2 == 4294967294 = False +2 == 4294967295 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 4294967293 = False +3 == 4294967294 = False +3 == 4294967295 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +4294967293 /= 4294967293 = False +4294967293 /= 4294967294 = True +4294967293 /= 4294967295 = True +4294967293 /= 0 = True +4294967293 /= 1 = True +4294967293 /= 2 = True +4294967293 /= 3 = True + +4294967294 /= 4294967293 = True +4294967294 /= 4294967294 = False +4294967294 /= 4294967295 = True +4294967294 /= 0 = True +4294967294 /= 1 = True +4294967294 /= 2 = True +4294967294 /= 3 = True + +4294967295 /= 4294967293 = True +4294967295 /= 4294967294 = True +4294967295 /= 4294967295 = False +4294967295 /= 0 = True +4294967295 /= 1 = True +4294967295 /= 2 = True +4294967295 /= 3 = True + +0 /= 4294967293 = True +0 /= 4294967294 = True +0 /= 4294967295 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 4294967293 = True +1 /= 4294967294 = True +1 /= 4294967295 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 4294967293 = True +2 /= 4294967294 = True +2 /= 4294967295 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 4294967293 = True +3 /= 4294967294 = True +3 /= 4294967295 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +4294967293 <= 4294967293 = True +4294967293 <= 4294967294 = True +4294967293 <= 4294967295 = True +4294967293 <= 0 = False +4294967293 <= 1 = False +4294967293 <= 2 = False +4294967293 <= 3 = False + +4294967294 <= 4294967293 = False +4294967294 <= 4294967294 = True +4294967294 <= 4294967295 = True +4294967294 <= 0 = False +4294967294 <= 1 = False +4294967294 <= 2 = False +4294967294 <= 3 = False + +4294967295 <= 4294967293 = False +4294967295 <= 4294967294 = False +4294967295 <= 4294967295 = True +4294967295 <= 0 = False +4294967295 <= 1 = False +4294967295 <= 2 = False +4294967295 <= 3 = False + +0 <= 4294967293 = True +0 <= 4294967294 = True +0 <= 4294967295 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 4294967293 = True +1 <= 4294967294 = True +1 <= 4294967295 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 4294967293 = True +2 <= 4294967294 = True +2 <= 4294967295 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 4294967293 = True +3 <= 4294967294 = True +3 <= 4294967295 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +4294967293 < 4294967293 = False +4294967293 < 4294967294 = True +4294967293 < 4294967295 = True +4294967293 < 0 = False +4294967293 < 1 = False +4294967293 < 2 = False +4294967293 < 3 = False + +4294967294 < 4294967293 = False +4294967294 < 4294967294 = False +4294967294 < 4294967295 = True +4294967294 < 0 = False +4294967294 < 1 = False +4294967294 < 2 = False +4294967294 < 3 = False + +4294967295 < 4294967293 = False +4294967295 < 4294967294 = False +4294967295 < 4294967295 = False +4294967295 < 0 = False +4294967295 < 1 = False +4294967295 < 2 = False +4294967295 < 3 = False + +0 < 4294967293 = True +0 < 4294967294 = True +0 < 4294967295 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 4294967293 = True +1 < 4294967294 = True +1 < 4294967295 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 4294967293 = True +2 < 4294967294 = True +2 < 4294967295 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 4294967293 = True +3 < 4294967294 = True +3 < 4294967295 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +4294967293 > 4294967293 = False +4294967293 > 4294967294 = False +4294967293 > 4294967295 = False +4294967293 > 0 = True +4294967293 > 1 = True +4294967293 > 2 = True +4294967293 > 3 = True + +4294967294 > 4294967293 = True +4294967294 > 4294967294 = False +4294967294 > 4294967295 = False +4294967294 > 0 = True +4294967294 > 1 = True +4294967294 > 2 = True +4294967294 > 3 = True + +4294967295 > 4294967293 = True +4294967295 > 4294967294 = True +4294967295 > 4294967295 = False +4294967295 > 0 = True +4294967295 > 1 = True +4294967295 > 2 = True +4294967295 > 3 = True + +0 > 4294967293 = False +0 > 4294967294 = False +0 > 4294967295 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 4294967293 = False +1 > 4294967294 = False +1 > 4294967295 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 4294967293 = False +2 > 4294967294 = False +2 > 4294967295 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 4294967293 = False +3 > 4294967294 = False +3 > 4294967295 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +4294967293 >= 4294967293 = True +4294967293 >= 4294967294 = False +4294967293 >= 4294967295 = False +4294967293 >= 0 = True +4294967293 >= 1 = True +4294967293 >= 2 = True +4294967293 >= 3 = True + +4294967294 >= 4294967293 = True +4294967294 >= 4294967294 = True +4294967294 >= 4294967295 = False +4294967294 >= 0 = True +4294967294 >= 1 = True +4294967294 >= 2 = True +4294967294 >= 3 = True + +4294967295 >= 4294967293 = True +4294967295 >= 4294967294 = True +4294967295 >= 4294967295 = True +4294967295 >= 0 = True +4294967295 >= 1 = True +4294967295 >= 2 = True +4294967295 >= 3 = True + +0 >= 4294967293 = False +0 >= 4294967294 = False +0 >= 4294967295 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 4294967293 = False +1 >= 4294967294 = False +1 >= 4294967295 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 4294967293 = False +2 >= 4294967294 = False +2 >= 4294967295 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 4294967293 = False +3 >= 4294967294 = False +3 >= 4294967295 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +4294967293 `compare` 4294967293 = EQ +4294967293 `compare` 4294967294 = LT +4294967293 `compare` 4294967295 = LT +4294967293 `compare` 0 = GT +4294967293 `compare` 1 = GT +4294967293 `compare` 2 = GT +4294967293 `compare` 3 = GT + +4294967294 `compare` 4294967293 = GT +4294967294 `compare` 4294967294 = EQ +4294967294 `compare` 4294967295 = LT +4294967294 `compare` 0 = GT +4294967294 `compare` 1 = GT +4294967294 `compare` 2 = GT +4294967294 `compare` 3 = GT + +4294967295 `compare` 4294967293 = GT +4294967295 `compare` 4294967294 = GT +4294967295 `compare` 4294967295 = EQ +4294967295 `compare` 0 = GT +4294967295 `compare` 1 = GT +4294967295 `compare` 2 = GT +4294967295 `compare` 3 = GT + +0 `compare` 4294967293 = LT +0 `compare` 4294967294 = LT +0 `compare` 4294967295 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 4294967293 = LT +1 `compare` 4294967294 = LT +1 `compare` 4294967295 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 4294967293 = LT +2 `compare` 4294967294 = LT +2 `compare` 4294967295 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 4294967293 = LT +3 `compare` 4294967294 = LT +3 `compare` 4294967295 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +4294967293 + 4294967293 = 4294967290 +4294967293 + 4294967294 = 4294967291 +4294967293 + 4294967295 = 4294967292 +4294967293 + 0 = 4294967293 +4294967293 + 1 = 4294967294 +4294967293 + 2 = 4294967295 +4294967293 + 3 = 0 + +4294967294 + 4294967293 = 4294967291 +4294967294 + 4294967294 = 4294967292 +4294967294 + 4294967295 = 4294967293 +4294967294 + 0 = 4294967294 +4294967294 + 1 = 4294967295 +4294967294 + 2 = 0 +4294967294 + 3 = 1 + +4294967295 + 4294967293 = 4294967292 +4294967295 + 4294967294 = 4294967293 +4294967295 + 4294967295 = 4294967294 +4294967295 + 0 = 4294967295 +4294967295 + 1 = 0 +4294967295 + 2 = 1 +4294967295 + 3 = 2 + +0 + 4294967293 = 4294967293 +0 + 4294967294 = 4294967294 +0 + 4294967295 = 4294967295 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 4294967293 = 4294967294 +1 + 4294967294 = 4294967295 +1 + 4294967295 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 4294967293 = 4294967295 +2 + 4294967294 = 0 +2 + 4294967295 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 4294967293 = 0 +3 + 4294967294 = 1 +3 + 4294967295 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +4294967293 - 4294967293 = 0 +4294967293 - 4294967294 = 4294967295 +4294967293 - 4294967295 = 4294967294 +4294967293 - 0 = 4294967293 +4294967293 - 1 = 4294967292 +4294967293 - 2 = 4294967291 +4294967293 - 3 = 4294967290 + +4294967294 - 4294967293 = 1 +4294967294 - 4294967294 = 0 +4294967294 - 4294967295 = 4294967295 +4294967294 - 0 = 4294967294 +4294967294 - 1 = 4294967293 +4294967294 - 2 = 4294967292 +4294967294 - 3 = 4294967291 + +4294967295 - 4294967293 = 2 +4294967295 - 4294967294 = 1 +4294967295 - 4294967295 = 0 +4294967295 - 0 = 4294967295 +4294967295 - 1 = 4294967294 +4294967295 - 2 = 4294967293 +4294967295 - 3 = 4294967292 + +0 - 4294967293 = 3 +0 - 4294967294 = 2 +0 - 4294967295 = 1 +0 - 0 = 0 +0 - 1 = 4294967295 +0 - 2 = 4294967294 +0 - 3 = 4294967293 + +1 - 4294967293 = 4 +1 - 4294967294 = 3 +1 - 4294967295 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 4294967295 +1 - 3 = 4294967294 + +2 - 4294967293 = 5 +2 - 4294967294 = 4 +2 - 4294967295 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 4294967295 + +3 - 4294967293 = 6 +3 - 4294967294 = 5 +3 - 4294967295 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +4294967293 * 4294967293 = 9 +4294967293 * 4294967294 = 6 +4294967293 * 4294967295 = 3 +4294967293 * 0 = 0 +4294967293 * 1 = 4294967293 +4294967293 * 2 = 4294967290 +4294967293 * 3 = 4294967287 + +4294967294 * 4294967293 = 6 +4294967294 * 4294967294 = 4 +4294967294 * 4294967295 = 2 +4294967294 * 0 = 0 +4294967294 * 1 = 4294967294 +4294967294 * 2 = 4294967292 +4294967294 * 3 = 4294967290 + +4294967295 * 4294967293 = 3 +4294967295 * 4294967294 = 2 +4294967295 * 4294967295 = 1 +4294967295 * 0 = 0 +4294967295 * 1 = 4294967295 +4294967295 * 2 = 4294967294 +4294967295 * 3 = 4294967293 + +0 * 4294967293 = 0 +0 * 4294967294 = 0 +0 * 4294967295 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 4294967293 = 4294967293 +1 * 4294967294 = 4294967294 +1 * 4294967295 = 4294967295 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 4294967293 = 4294967290 +2 * 4294967294 = 4294967292 +2 * 4294967295 = 4294967294 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 4294967293 = 4294967287 +3 * 4294967294 = 4294967290 +3 * 4294967295 = 4294967293 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 4294967293 = 3 +negate 4294967294 = 2 +negate 4294967295 = 1 +negate 0 = 0 +negate 1 = 4294967295 +negate 2 = 4294967294 +negate 3 = 4294967293 +# +testReal +toRational 4294967293 = 4294967293 % 1 +toRational 4294967294 = 4294967294 % 1 +toRational 4294967295 = 4294967295 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +4294967293 `divMod` 4294967293 = (1,0) +4294967293 `divMod` 4294967294 = (0,4294967293) +4294967293 `divMod` 4294967295 = (0,4294967293) +4294967293 `divMod` 0 = divide by zero +4294967293 `divMod` 1 = (4294967293,0) +4294967293 `divMod` 2 = (2147483646,1) +4294967293 `divMod` 3 = (1431655764,1) + +4294967294 `divMod` 4294967293 = (1,1) +4294967294 `divMod` 4294967294 = (1,0) +4294967294 `divMod` 4294967295 = (0,4294967294) +4294967294 `divMod` 0 = divide by zero +4294967294 `divMod` 1 = (4294967294,0) +4294967294 `divMod` 2 = (2147483647,0) +4294967294 `divMod` 3 = (1431655764,2) + +4294967295 `divMod` 4294967293 = (1,2) +4294967295 `divMod` 4294967294 = (1,1) +4294967295 `divMod` 4294967295 = (1,0) +4294967295 `divMod` 0 = divide by zero +4294967295 `divMod` 1 = (4294967295,0) +4294967295 `divMod` 2 = (2147483647,1) +4294967295 `divMod` 3 = (1431655765,0) + +0 `divMod` 4294967293 = (0,0) +0 `divMod` 4294967294 = (0,0) +0 `divMod` 4294967295 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 4294967293 = (0,1) +1 `divMod` 4294967294 = (0,1) +1 `divMod` 4294967295 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 4294967293 = (0,2) +2 `divMod` 4294967294 = (0,2) +2 `divMod` 4294967295 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 4294967293 = (0,3) +3 `divMod` 4294967294 = (0,3) +3 `divMod` 4294967295 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +4294967293 `div` 4294967293 = 1 +4294967293 `div` 4294967294 = 0 +4294967293 `div` 4294967295 = 0 +4294967293 `div` 0 = divide by zero +4294967293 `div` 1 = 4294967293 +4294967293 `div` 2 = 2147483646 +4294967293 `div` 3 = 1431655764 + +4294967294 `div` 4294967293 = 1 +4294967294 `div` 4294967294 = 1 +4294967294 `div` 4294967295 = 0 +4294967294 `div` 0 = divide by zero +4294967294 `div` 1 = 4294967294 +4294967294 `div` 2 = 2147483647 +4294967294 `div` 3 = 1431655764 + +4294967295 `div` 4294967293 = 1 +4294967295 `div` 4294967294 = 1 +4294967295 `div` 4294967295 = 1 +4294967295 `div` 0 = divide by zero +4294967295 `div` 1 = 4294967295 +4294967295 `div` 2 = 2147483647 +4294967295 `div` 3 = 1431655765 + +0 `div` 4294967293 = 0 +0 `div` 4294967294 = 0 +0 `div` 4294967295 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 4294967293 = 0 +1 `div` 4294967294 = 0 +1 `div` 4294967295 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 4294967293 = 0 +2 `div` 4294967294 = 0 +2 `div` 4294967295 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 4294967293 = 0 +3 `div` 4294967294 = 0 +3 `div` 4294967295 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +4294967293 `mod` 4294967293 = 0 +4294967293 `mod` 4294967294 = 4294967293 +4294967293 `mod` 4294967295 = 4294967293 +4294967293 `mod` 0 = divide by zero +4294967293 `mod` 1 = 0 +4294967293 `mod` 2 = 1 +4294967293 `mod` 3 = 1 + +4294967294 `mod` 4294967293 = 1 +4294967294 `mod` 4294967294 = 0 +4294967294 `mod` 4294967295 = 4294967294 +4294967294 `mod` 0 = divide by zero +4294967294 `mod` 1 = 0 +4294967294 `mod` 2 = 0 +4294967294 `mod` 3 = 2 + +4294967295 `mod` 4294967293 = 2 +4294967295 `mod` 4294967294 = 1 +4294967295 `mod` 4294967295 = 0 +4294967295 `mod` 0 = divide by zero +4294967295 `mod` 1 = 0 +4294967295 `mod` 2 = 1 +4294967295 `mod` 3 = 0 + +0 `mod` 4294967293 = 0 +0 `mod` 4294967294 = 0 +0 `mod` 4294967295 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 4294967293 = 1 +1 `mod` 4294967294 = 1 +1 `mod` 4294967295 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 4294967293 = 2 +2 `mod` 4294967294 = 2 +2 `mod` 4294967295 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 4294967293 = 3 +3 `mod` 4294967294 = 3 +3 `mod` 4294967295 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +4294967293 `quotRem` 4294967293 = (1,0) +4294967293 `quotRem` 4294967294 = (0,4294967293) +4294967293 `quotRem` 4294967295 = (0,4294967293) +4294967293 `quotRem` 0 = divide by zero +4294967293 `quotRem` 1 = (4294967293,0) +4294967293 `quotRem` 2 = (2147483646,1) +4294967293 `quotRem` 3 = (1431655764,1) + +4294967294 `quotRem` 4294967293 = (1,1) +4294967294 `quotRem` 4294967294 = (1,0) +4294967294 `quotRem` 4294967295 = (0,4294967294) +4294967294 `quotRem` 0 = divide by zero +4294967294 `quotRem` 1 = (4294967294,0) +4294967294 `quotRem` 2 = (2147483647,0) +4294967294 `quotRem` 3 = (1431655764,2) + +4294967295 `quotRem` 4294967293 = (1,2) +4294967295 `quotRem` 4294967294 = (1,1) +4294967295 `quotRem` 4294967295 = (1,0) +4294967295 `quotRem` 0 = divide by zero +4294967295 `quotRem` 1 = (4294967295,0) +4294967295 `quotRem` 2 = (2147483647,1) +4294967295 `quotRem` 3 = (1431655765,0) + +0 `quotRem` 4294967293 = (0,0) +0 `quotRem` 4294967294 = (0,0) +0 `quotRem` 4294967295 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 4294967293 = (0,1) +1 `quotRem` 4294967294 = (0,1) +1 `quotRem` 4294967295 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 4294967293 = (0,2) +2 `quotRem` 4294967294 = (0,2) +2 `quotRem` 4294967295 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 4294967293 = (0,3) +3 `quotRem` 4294967294 = (0,3) +3 `quotRem` 4294967295 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +4294967293 `quot` 4294967293 = 1 +4294967293 `quot` 4294967294 = 0 +4294967293 `quot` 4294967295 = 0 +4294967293 `quot` 0 = divide by zero +4294967293 `quot` 1 = 4294967293 +4294967293 `quot` 2 = 2147483646 +4294967293 `quot` 3 = 1431655764 + +4294967294 `quot` 4294967293 = 1 +4294967294 `quot` 4294967294 = 1 +4294967294 `quot` 4294967295 = 0 +4294967294 `quot` 0 = divide by zero +4294967294 `quot` 1 = 4294967294 +4294967294 `quot` 2 = 2147483647 +4294967294 `quot` 3 = 1431655764 + +4294967295 `quot` 4294967293 = 1 +4294967295 `quot` 4294967294 = 1 +4294967295 `quot` 4294967295 = 1 +4294967295 `quot` 0 = divide by zero +4294967295 `quot` 1 = 4294967295 +4294967295 `quot` 2 = 2147483647 +4294967295 `quot` 3 = 1431655765 + +0 `quot` 4294967293 = 0 +0 `quot` 4294967294 = 0 +0 `quot` 4294967295 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 4294967293 = 0 +1 `quot` 4294967294 = 0 +1 `quot` 4294967295 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 4294967293 = 0 +2 `quot` 4294967294 = 0 +2 `quot` 4294967295 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 4294967293 = 0 +3 `quot` 4294967294 = 0 +3 `quot` 4294967295 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +4294967293 `rem` 4294967293 = 0 +4294967293 `rem` 4294967294 = 4294967293 +4294967293 `rem` 4294967295 = 4294967293 +4294967293 `rem` 0 = divide by zero +4294967293 `rem` 1 = 0 +4294967293 `rem` 2 = 1 +4294967293 `rem` 3 = 1 + +4294967294 `rem` 4294967293 = 1 +4294967294 `rem` 4294967294 = 0 +4294967294 `rem` 4294967295 = 4294967294 +4294967294 `rem` 0 = divide by zero +4294967294 `rem` 1 = 0 +4294967294 `rem` 2 = 0 +4294967294 `rem` 3 = 2 + +4294967295 `rem` 4294967293 = 2 +4294967295 `rem` 4294967294 = 1 +4294967295 `rem` 4294967295 = 0 +4294967295 `rem` 0 = divide by zero +4294967295 `rem` 1 = 0 +4294967295 `rem` 2 = 1 +4294967295 `rem` 3 = 0 + +0 `rem` 4294967293 = 0 +0 `rem` 4294967294 = 0 +0 `rem` 4294967295 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 4294967293 = 1 +1 `rem` 4294967294 = 1 +1 `rem` 4294967295 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 4294967293 = 2 +2 `rem` 4294967294 = 2 +2 `rem` 4294967295 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 4294967293 = 3 +3 `rem` 4294967294 = 3 +3 `rem` 4294967295 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,4294967295] +Int : [0,0,-1] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [0,0,4294967295] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [0,0,4294967295] +testBits +4294967293 .&. 4294967293 = 4294967293 +4294967293 .&. 4294967294 = 4294967292 +4294967293 .&. 4294967295 = 4294967293 +4294967293 .&. 0 = 0 +4294967293 .&. 1 = 1 +4294967293 .&. 2 = 0 +4294967293 .&. 3 = 1 + +4294967294 .&. 4294967293 = 4294967292 +4294967294 .&. 4294967294 = 4294967294 +4294967294 .&. 4294967295 = 4294967294 +4294967294 .&. 0 = 0 +4294967294 .&. 1 = 0 +4294967294 .&. 2 = 2 +4294967294 .&. 3 = 2 + +4294967295 .&. 4294967293 = 4294967293 +4294967295 .&. 4294967294 = 4294967294 +4294967295 .&. 4294967295 = 4294967295 +4294967295 .&. 0 = 0 +4294967295 .&. 1 = 1 +4294967295 .&. 2 = 2 +4294967295 .&. 3 = 3 + +0 .&. 4294967293 = 0 +0 .&. 4294967294 = 0 +0 .&. 4294967295 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 4294967293 = 1 +1 .&. 4294967294 = 0 +1 .&. 4294967295 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 4294967293 = 0 +2 .&. 4294967294 = 2 +2 .&. 4294967295 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 4294967293 = 1 +3 .&. 4294967294 = 2 +3 .&. 4294967295 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +4294967293 .|. 4294967293 = 4294967293 +4294967293 .|. 4294967294 = 4294967295 +4294967293 .|. 4294967295 = 4294967295 +4294967293 .|. 0 = 4294967293 +4294967293 .|. 1 = 4294967293 +4294967293 .|. 2 = 4294967295 +4294967293 .|. 3 = 4294967295 + +4294967294 .|. 4294967293 = 4294967295 +4294967294 .|. 4294967294 = 4294967294 +4294967294 .|. 4294967295 = 4294967295 +4294967294 .|. 0 = 4294967294 +4294967294 .|. 1 = 4294967295 +4294967294 .|. 2 = 4294967294 +4294967294 .|. 3 = 4294967295 + +4294967295 .|. 4294967293 = 4294967295 +4294967295 .|. 4294967294 = 4294967295 +4294967295 .|. 4294967295 = 4294967295 +4294967295 .|. 0 = 4294967295 +4294967295 .|. 1 = 4294967295 +4294967295 .|. 2 = 4294967295 +4294967295 .|. 3 = 4294967295 + +0 .|. 4294967293 = 4294967293 +0 .|. 4294967294 = 4294967294 +0 .|. 4294967295 = 4294967295 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 4294967293 = 4294967293 +1 .|. 4294967294 = 4294967295 +1 .|. 4294967295 = 4294967295 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 4294967293 = 4294967295 +2 .|. 4294967294 = 4294967294 +2 .|. 4294967295 = 4294967295 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 4294967293 = 4294967295 +3 .|. 4294967294 = 4294967295 +3 .|. 4294967295 = 4294967295 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +4294967293 `xor` 4294967293 = 0 +4294967293 `xor` 4294967294 = 3 +4294967293 `xor` 4294967295 = 2 +4294967293 `xor` 0 = 4294967293 +4294967293 `xor` 1 = 4294967292 +4294967293 `xor` 2 = 4294967295 +4294967293 `xor` 3 = 4294967294 + +4294967294 `xor` 4294967293 = 3 +4294967294 `xor` 4294967294 = 0 +4294967294 `xor` 4294967295 = 1 +4294967294 `xor` 0 = 4294967294 +4294967294 `xor` 1 = 4294967295 +4294967294 `xor` 2 = 4294967292 +4294967294 `xor` 3 = 4294967293 + +4294967295 `xor` 4294967293 = 2 +4294967295 `xor` 4294967294 = 1 +4294967295 `xor` 4294967295 = 0 +4294967295 `xor` 0 = 4294967295 +4294967295 `xor` 1 = 4294967294 +4294967295 `xor` 2 = 4294967293 +4294967295 `xor` 3 = 4294967292 + +0 `xor` 4294967293 = 4294967293 +0 `xor` 4294967294 = 4294967294 +0 `xor` 4294967295 = 4294967295 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 4294967293 = 4294967292 +1 `xor` 4294967294 = 4294967295 +1 `xor` 4294967295 = 4294967294 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 4294967293 = 4294967295 +2 `xor` 4294967294 = 4294967292 +2 `xor` 4294967295 = 4294967293 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 4294967293 = 4294967294 +3 `xor` 4294967294 = 4294967293 +3 `xor` 4294967295 = 4294967292 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 4294967293 = 2 +complement 4294967294 = 1 +complement 4294967295 = 0 +complement 0 = 4294967295 +complement 1 = 4294967294 +complement 2 = 4294967293 +complement 3 = 4294967292 +# +4294967293 `shiftL` 0 = 4294967293 +4294967293 `shiftL` 1 = 4294967290 +4294967293 `shiftL` 2 = 4294967284 +4294967293 `shiftL` 3 = 4294967272 +4294967293 `shiftL` 32 = 0 +4294967293 `shiftL` 64 = 0 + +4294967294 `shiftL` 0 = 4294967294 +4294967294 `shiftL` 1 = 4294967292 +4294967294 `shiftL` 2 = 4294967288 +4294967294 `shiftL` 3 = 4294967280 +4294967294 `shiftL` 32 = 0 +4294967294 `shiftL` 64 = 0 + +4294967295 `shiftL` 0 = 4294967295 +4294967295 `shiftL` 1 = 4294967294 +4294967295 `shiftL` 2 = 4294967292 +4294967295 `shiftL` 3 = 4294967288 +4294967295 `shiftL` 32 = 0 +4294967295 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +4294967293 `shiftR` 0 = 4294967293 +4294967293 `shiftR` 1 = 2147483646 +4294967293 `shiftR` 2 = 1073741823 +4294967293 `shiftR` 3 = 536870911 +4294967293 `shiftR` 32 = 0 +4294967293 `shiftR` 64 = 0 + +4294967294 `shiftR` 0 = 4294967294 +4294967294 `shiftR` 1 = 2147483647 +4294967294 `shiftR` 2 = 1073741823 +4294967294 `shiftR` 3 = 536870911 +4294967294 `shiftR` 32 = 0 +4294967294 `shiftR` 64 = 0 + +4294967295 `shiftR` 0 = 4294967295 +4294967295 `shiftR` 1 = 2147483647 +4294967295 `shiftR` 2 = 1073741823 +4294967295 `shiftR` 3 = 536870911 +4294967295 `shiftR` 32 = 0 +4294967295 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +4294967293 `rotate` -3 = 3221225471 +4294967293 `rotate` -2 = 2147483647 +4294967293 `rotate` -1 = 4294967294 +4294967293 `rotate` 0 = 4294967293 +4294967293 `rotate` 1 = 4294967291 +4294967293 `rotate` 2 = 4294967287 +4294967293 `rotate` 3 = 4294967279 +4294967293 `rotate` -64 = 4294967293 +4294967293 `rotate` -32 = 4294967293 +4294967293 `rotate` 32 = 4294967293 +4294967293 `rotate` 64 = 4294967293 + +4294967294 `rotate` -3 = 3758096383 +4294967294 `rotate` -2 = 3221225471 +4294967294 `rotate` -1 = 2147483647 +4294967294 `rotate` 0 = 4294967294 +4294967294 `rotate` 1 = 4294967293 +4294967294 `rotate` 2 = 4294967291 +4294967294 `rotate` 3 = 4294967287 +4294967294 `rotate` -64 = 4294967294 +4294967294 `rotate` -32 = 4294967294 +4294967294 `rotate` 32 = 4294967294 +4294967294 `rotate` 64 = 4294967294 + +4294967295 `rotate` -3 = 4294967295 +4294967295 `rotate` -2 = 4294967295 +4294967295 `rotate` -1 = 4294967295 +4294967295 `rotate` 0 = 4294967295 +4294967295 `rotate` 1 = 4294967295 +4294967295 `rotate` 2 = 4294967295 +4294967295 `rotate` 3 = 4294967295 +4294967295 `rotate` -64 = 4294967295 +4294967295 `rotate` -32 = 4294967295 +4294967295 `rotate` 32 = 4294967295 +4294967295 `rotate` 64 = 4294967295 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 536870912 +1 `rotate` -2 = 1073741824 +1 `rotate` -1 = 2147483648 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 1073741824 +2 `rotate` -2 = 2147483648 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 1610612736 +3 `rotate` -2 = 3221225472 +3 `rotate` -1 = 2147483649 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +4294967293 `setBit` 0 = 4294967293 +4294967293 `setBit` 1 = 4294967295 +4294967293 `setBit` 2 = 4294967293 +4294967293 `setBit` 3 = 4294967293 +4294967293 `setBit` 32 = 4294967293 +4294967293 `setBit` 64 = 4294967293 + +4294967294 `setBit` 0 = 4294967295 +4294967294 `setBit` 1 = 4294967294 +4294967294 `setBit` 2 = 4294967294 +4294967294 `setBit` 3 = 4294967294 +4294967294 `setBit` 32 = 4294967294 +4294967294 `setBit` 64 = 4294967294 + +4294967295 `setBit` 0 = 4294967295 +4294967295 `setBit` 1 = 4294967295 +4294967295 `setBit` 2 = 4294967295 +4294967295 `setBit` 3 = 4294967295 +4294967295 `setBit` 32 = 4294967295 +4294967295 `setBit` 64 = 4294967295 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +4294967293 `clearBit` 0 = 4294967292 +4294967293 `clearBit` 1 = 4294967293 +4294967293 `clearBit` 2 = 4294967289 +4294967293 `clearBit` 3 = 4294967285 +4294967293 `clearBit` 32 = 4294967293 +4294967293 `clearBit` 64 = 4294967293 + +4294967294 `clearBit` 0 = 4294967294 +4294967294 `clearBit` 1 = 4294967292 +4294967294 `clearBit` 2 = 4294967290 +4294967294 `clearBit` 3 = 4294967286 +4294967294 `clearBit` 32 = 4294967294 +4294967294 `clearBit` 64 = 4294967294 + +4294967295 `clearBit` 0 = 4294967294 +4294967295 `clearBit` 1 = 4294967293 +4294967295 `clearBit` 2 = 4294967291 +4294967295 `clearBit` 3 = 4294967287 +4294967295 `clearBit` 32 = 4294967295 +4294967295 `clearBit` 64 = 4294967295 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +4294967293 `complementBit` 0 = 4294967292 +4294967293 `complementBit` 1 = 4294967295 +4294967293 `complementBit` 2 = 4294967289 +4294967293 `complementBit` 3 = 4294967285 +4294967293 `complementBit` 32 = 4294967293 +4294967293 `complementBit` 64 = 4294967293 + +4294967294 `complementBit` 0 = 4294967295 +4294967294 `complementBit` 1 = 4294967292 +4294967294 `complementBit` 2 = 4294967290 +4294967294 `complementBit` 3 = 4294967286 +4294967294 `complementBit` 32 = 4294967294 +4294967294 `complementBit` 64 = 4294967294 + +4294967295 `complementBit` 0 = 4294967294 +4294967295 `complementBit` 1 = 4294967293 +4294967295 `complementBit` 2 = 4294967291 +4294967295 `complementBit` 3 = 4294967287 +4294967295 `complementBit` 32 = 4294967295 +4294967295 `complementBit` 64 = 4294967295 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +4294967293 `testBit` 0 = True +4294967293 `testBit` 1 = False +4294967293 `testBit` 2 = True +4294967293 `testBit` 3 = True +4294967293 `testBit` 32 = False +4294967293 `testBit` 64 = False + +4294967294 `testBit` 0 = False +4294967294 `testBit` 1 = True +4294967294 `testBit` 2 = True +4294967294 `testBit` 3 = True +4294967294 `testBit` 32 = False +4294967294 `testBit` 64 = False + +4294967295 `testBit` 0 = True +4294967295 `testBit` 1 = True +4294967295 `testBit` 2 = True +4294967295 `testBit` 3 = True +4294967295 `testBit` 32 = False +4294967295 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 4294967293 = 32 +bitSize 4294967294 = 32 +bitSize 4294967295 = 32 +bitSize 0 = 32 +bitSize 1 = 32 +bitSize 2 = 32 +bitSize 3 = 32 +# +isSigned 4294967293 = False +isSigned 4294967294 = False +isSigned 4294967295 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word64 +-------------------------------- +testBounded +(18446744073709551615,0,1) +(18446744073709551614,18446744073709551615,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[18446744073709551613,18446744073709551614,18446744073709551615,0,1,2,3] +[18446744073709551613,18446744073709551614,18446744073709551615,0,1,2,3] +testEq +18446744073709551613 == 18446744073709551613 = True +18446744073709551613 == 18446744073709551614 = False +18446744073709551613 == 18446744073709551615 = False +18446744073709551613 == 0 = False +18446744073709551613 == 1 = False +18446744073709551613 == 2 = False +18446744073709551613 == 3 = False + +18446744073709551614 == 18446744073709551613 = False +18446744073709551614 == 18446744073709551614 = True +18446744073709551614 == 18446744073709551615 = False +18446744073709551614 == 0 = False +18446744073709551614 == 1 = False +18446744073709551614 == 2 = False +18446744073709551614 == 3 = False + +18446744073709551615 == 18446744073709551613 = False +18446744073709551615 == 18446744073709551614 = False +18446744073709551615 == 18446744073709551615 = True +18446744073709551615 == 0 = False +18446744073709551615 == 1 = False +18446744073709551615 == 2 = False +18446744073709551615 == 3 = False + +0 == 18446744073709551613 = False +0 == 18446744073709551614 = False +0 == 18446744073709551615 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 18446744073709551613 = False +1 == 18446744073709551614 = False +1 == 18446744073709551615 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 18446744073709551613 = False +2 == 18446744073709551614 = False +2 == 18446744073709551615 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 18446744073709551613 = False +3 == 18446744073709551614 = False +3 == 18446744073709551615 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +18446744073709551613 /= 18446744073709551613 = False +18446744073709551613 /= 18446744073709551614 = True +18446744073709551613 /= 18446744073709551615 = True +18446744073709551613 /= 0 = True +18446744073709551613 /= 1 = True +18446744073709551613 /= 2 = True +18446744073709551613 /= 3 = True + +18446744073709551614 /= 18446744073709551613 = True +18446744073709551614 /= 18446744073709551614 = False +18446744073709551614 /= 18446744073709551615 = True +18446744073709551614 /= 0 = True +18446744073709551614 /= 1 = True +18446744073709551614 /= 2 = True +18446744073709551614 /= 3 = True + +18446744073709551615 /= 18446744073709551613 = True +18446744073709551615 /= 18446744073709551614 = True +18446744073709551615 /= 18446744073709551615 = False +18446744073709551615 /= 0 = True +18446744073709551615 /= 1 = True +18446744073709551615 /= 2 = True +18446744073709551615 /= 3 = True + +0 /= 18446744073709551613 = True +0 /= 18446744073709551614 = True +0 /= 18446744073709551615 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 18446744073709551613 = True +1 /= 18446744073709551614 = True +1 /= 18446744073709551615 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 18446744073709551613 = True +2 /= 18446744073709551614 = True +2 /= 18446744073709551615 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 18446744073709551613 = True +3 /= 18446744073709551614 = True +3 /= 18446744073709551615 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +18446744073709551613 <= 18446744073709551613 = True +18446744073709551613 <= 18446744073709551614 = True +18446744073709551613 <= 18446744073709551615 = True +18446744073709551613 <= 0 = False +18446744073709551613 <= 1 = False +18446744073709551613 <= 2 = False +18446744073709551613 <= 3 = False + +18446744073709551614 <= 18446744073709551613 = False +18446744073709551614 <= 18446744073709551614 = True +18446744073709551614 <= 18446744073709551615 = True +18446744073709551614 <= 0 = False +18446744073709551614 <= 1 = False +18446744073709551614 <= 2 = False +18446744073709551614 <= 3 = False + +18446744073709551615 <= 18446744073709551613 = False +18446744073709551615 <= 18446744073709551614 = False +18446744073709551615 <= 18446744073709551615 = True +18446744073709551615 <= 0 = False +18446744073709551615 <= 1 = False +18446744073709551615 <= 2 = False +18446744073709551615 <= 3 = False + +0 <= 18446744073709551613 = True +0 <= 18446744073709551614 = True +0 <= 18446744073709551615 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 18446744073709551613 = True +1 <= 18446744073709551614 = True +1 <= 18446744073709551615 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 18446744073709551613 = True +2 <= 18446744073709551614 = True +2 <= 18446744073709551615 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 18446744073709551613 = True +3 <= 18446744073709551614 = True +3 <= 18446744073709551615 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +18446744073709551613 < 18446744073709551613 = False +18446744073709551613 < 18446744073709551614 = True +18446744073709551613 < 18446744073709551615 = True +18446744073709551613 < 0 = False +18446744073709551613 < 1 = False +18446744073709551613 < 2 = False +18446744073709551613 < 3 = False + +18446744073709551614 < 18446744073709551613 = False +18446744073709551614 < 18446744073709551614 = False +18446744073709551614 < 18446744073709551615 = True +18446744073709551614 < 0 = False +18446744073709551614 < 1 = False +18446744073709551614 < 2 = False +18446744073709551614 < 3 = False + +18446744073709551615 < 18446744073709551613 = False +18446744073709551615 < 18446744073709551614 = False +18446744073709551615 < 18446744073709551615 = False +18446744073709551615 < 0 = False +18446744073709551615 < 1 = False +18446744073709551615 < 2 = False +18446744073709551615 < 3 = False + +0 < 18446744073709551613 = True +0 < 18446744073709551614 = True +0 < 18446744073709551615 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 18446744073709551613 = True +1 < 18446744073709551614 = True +1 < 18446744073709551615 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 18446744073709551613 = True +2 < 18446744073709551614 = True +2 < 18446744073709551615 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 18446744073709551613 = True +3 < 18446744073709551614 = True +3 < 18446744073709551615 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +18446744073709551613 > 18446744073709551613 = False +18446744073709551613 > 18446744073709551614 = False +18446744073709551613 > 18446744073709551615 = False +18446744073709551613 > 0 = True +18446744073709551613 > 1 = True +18446744073709551613 > 2 = True +18446744073709551613 > 3 = True + +18446744073709551614 > 18446744073709551613 = True +18446744073709551614 > 18446744073709551614 = False +18446744073709551614 > 18446744073709551615 = False +18446744073709551614 > 0 = True +18446744073709551614 > 1 = True +18446744073709551614 > 2 = True +18446744073709551614 > 3 = True + +18446744073709551615 > 18446744073709551613 = True +18446744073709551615 > 18446744073709551614 = True +18446744073709551615 > 18446744073709551615 = False +18446744073709551615 > 0 = True +18446744073709551615 > 1 = True +18446744073709551615 > 2 = True +18446744073709551615 > 3 = True + +0 > 18446744073709551613 = False +0 > 18446744073709551614 = False +0 > 18446744073709551615 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 18446744073709551613 = False +1 > 18446744073709551614 = False +1 > 18446744073709551615 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 18446744073709551613 = False +2 > 18446744073709551614 = False +2 > 18446744073709551615 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 18446744073709551613 = False +3 > 18446744073709551614 = False +3 > 18446744073709551615 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +18446744073709551613 >= 18446744073709551613 = True +18446744073709551613 >= 18446744073709551614 = False +18446744073709551613 >= 18446744073709551615 = False +18446744073709551613 >= 0 = True +18446744073709551613 >= 1 = True +18446744073709551613 >= 2 = True +18446744073709551613 >= 3 = True + +18446744073709551614 >= 18446744073709551613 = True +18446744073709551614 >= 18446744073709551614 = True +18446744073709551614 >= 18446744073709551615 = False +18446744073709551614 >= 0 = True +18446744073709551614 >= 1 = True +18446744073709551614 >= 2 = True +18446744073709551614 >= 3 = True + +18446744073709551615 >= 18446744073709551613 = True +18446744073709551615 >= 18446744073709551614 = True +18446744073709551615 >= 18446744073709551615 = True +18446744073709551615 >= 0 = True +18446744073709551615 >= 1 = True +18446744073709551615 >= 2 = True +18446744073709551615 >= 3 = True + +0 >= 18446744073709551613 = False +0 >= 18446744073709551614 = False +0 >= 18446744073709551615 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 18446744073709551613 = False +1 >= 18446744073709551614 = False +1 >= 18446744073709551615 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 18446744073709551613 = False +2 >= 18446744073709551614 = False +2 >= 18446744073709551615 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 18446744073709551613 = False +3 >= 18446744073709551614 = False +3 >= 18446744073709551615 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +18446744073709551613 `compare` 18446744073709551613 = EQ +18446744073709551613 `compare` 18446744073709551614 = LT +18446744073709551613 `compare` 18446744073709551615 = LT +18446744073709551613 `compare` 0 = GT +18446744073709551613 `compare` 1 = GT +18446744073709551613 `compare` 2 = GT +18446744073709551613 `compare` 3 = GT + +18446744073709551614 `compare` 18446744073709551613 = GT +18446744073709551614 `compare` 18446744073709551614 = EQ +18446744073709551614 `compare` 18446744073709551615 = LT +18446744073709551614 `compare` 0 = GT +18446744073709551614 `compare` 1 = GT +18446744073709551614 `compare` 2 = GT +18446744073709551614 `compare` 3 = GT + +18446744073709551615 `compare` 18446744073709551613 = GT +18446744073709551615 `compare` 18446744073709551614 = GT +18446744073709551615 `compare` 18446744073709551615 = EQ +18446744073709551615 `compare` 0 = GT +18446744073709551615 `compare` 1 = GT +18446744073709551615 `compare` 2 = GT +18446744073709551615 `compare` 3 = GT + +0 `compare` 18446744073709551613 = LT +0 `compare` 18446744073709551614 = LT +0 `compare` 18446744073709551615 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 18446744073709551613 = LT +1 `compare` 18446744073709551614 = LT +1 `compare` 18446744073709551615 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 18446744073709551613 = LT +2 `compare` 18446744073709551614 = LT +2 `compare` 18446744073709551615 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 18446744073709551613 = LT +3 `compare` 18446744073709551614 = LT +3 `compare` 18446744073709551615 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +18446744073709551613 + 18446744073709551613 = 18446744073709551610 +18446744073709551613 + 18446744073709551614 = 18446744073709551611 +18446744073709551613 + 18446744073709551615 = 18446744073709551612 +18446744073709551613 + 0 = 18446744073709551613 +18446744073709551613 + 1 = 18446744073709551614 +18446744073709551613 + 2 = 18446744073709551615 +18446744073709551613 + 3 = 0 + +18446744073709551614 + 18446744073709551613 = 18446744073709551611 +18446744073709551614 + 18446744073709551614 = 18446744073709551612 +18446744073709551614 + 18446744073709551615 = 18446744073709551613 +18446744073709551614 + 0 = 18446744073709551614 +18446744073709551614 + 1 = 18446744073709551615 +18446744073709551614 + 2 = 0 +18446744073709551614 + 3 = 1 + +18446744073709551615 + 18446744073709551613 = 18446744073709551612 +18446744073709551615 + 18446744073709551614 = 18446744073709551613 +18446744073709551615 + 18446744073709551615 = 18446744073709551614 +18446744073709551615 + 0 = 18446744073709551615 +18446744073709551615 + 1 = 0 +18446744073709551615 + 2 = 1 +18446744073709551615 + 3 = 2 + +0 + 18446744073709551613 = 18446744073709551613 +0 + 18446744073709551614 = 18446744073709551614 +0 + 18446744073709551615 = 18446744073709551615 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 18446744073709551613 = 18446744073709551614 +1 + 18446744073709551614 = 18446744073709551615 +1 + 18446744073709551615 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 18446744073709551613 = 18446744073709551615 +2 + 18446744073709551614 = 0 +2 + 18446744073709551615 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 18446744073709551613 = 0 +3 + 18446744073709551614 = 1 +3 + 18446744073709551615 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +18446744073709551613 - 18446744073709551613 = 0 +18446744073709551613 - 18446744073709551614 = 18446744073709551615 +18446744073709551613 - 18446744073709551615 = 18446744073709551614 +18446744073709551613 - 0 = 18446744073709551613 +18446744073709551613 - 1 = 18446744073709551612 +18446744073709551613 - 2 = 18446744073709551611 +18446744073709551613 - 3 = 18446744073709551610 + +18446744073709551614 - 18446744073709551613 = 1 +18446744073709551614 - 18446744073709551614 = 0 +18446744073709551614 - 18446744073709551615 = 18446744073709551615 +18446744073709551614 - 0 = 18446744073709551614 +18446744073709551614 - 1 = 18446744073709551613 +18446744073709551614 - 2 = 18446744073709551612 +18446744073709551614 - 3 = 18446744073709551611 + +18446744073709551615 - 18446744073709551613 = 2 +18446744073709551615 - 18446744073709551614 = 1 +18446744073709551615 - 18446744073709551615 = 0 +18446744073709551615 - 0 = 18446744073709551615 +18446744073709551615 - 1 = 18446744073709551614 +18446744073709551615 - 2 = 18446744073709551613 +18446744073709551615 - 3 = 18446744073709551612 + +0 - 18446744073709551613 = 3 +0 - 18446744073709551614 = 2 +0 - 18446744073709551615 = 1 +0 - 0 = 0 +0 - 1 = 18446744073709551615 +0 - 2 = 18446744073709551614 +0 - 3 = 18446744073709551613 + +1 - 18446744073709551613 = 4 +1 - 18446744073709551614 = 3 +1 - 18446744073709551615 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 18446744073709551615 +1 - 3 = 18446744073709551614 + +2 - 18446744073709551613 = 5 +2 - 18446744073709551614 = 4 +2 - 18446744073709551615 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 18446744073709551615 + +3 - 18446744073709551613 = 6 +3 - 18446744073709551614 = 5 +3 - 18446744073709551615 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +18446744073709551613 * 18446744073709551613 = 9 +18446744073709551613 * 18446744073709551614 = 6 +18446744073709551613 * 18446744073709551615 = 3 +18446744073709551613 * 0 = 0 +18446744073709551613 * 1 = 18446744073709551613 +18446744073709551613 * 2 = 18446744073709551610 +18446744073709551613 * 3 = 18446744073709551607 + +18446744073709551614 * 18446744073709551613 = 6 +18446744073709551614 * 18446744073709551614 = 4 +18446744073709551614 * 18446744073709551615 = 2 +18446744073709551614 * 0 = 0 +18446744073709551614 * 1 = 18446744073709551614 +18446744073709551614 * 2 = 18446744073709551612 +18446744073709551614 * 3 = 18446744073709551610 + +18446744073709551615 * 18446744073709551613 = 3 +18446744073709551615 * 18446744073709551614 = 2 +18446744073709551615 * 18446744073709551615 = 1 +18446744073709551615 * 0 = 0 +18446744073709551615 * 1 = 18446744073709551615 +18446744073709551615 * 2 = 18446744073709551614 +18446744073709551615 * 3 = 18446744073709551613 + +0 * 18446744073709551613 = 0 +0 * 18446744073709551614 = 0 +0 * 18446744073709551615 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 18446744073709551613 = 18446744073709551613 +1 * 18446744073709551614 = 18446744073709551614 +1 * 18446744073709551615 = 18446744073709551615 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 18446744073709551613 = 18446744073709551610 +2 * 18446744073709551614 = 18446744073709551612 +2 * 18446744073709551615 = 18446744073709551614 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 18446744073709551613 = 18446744073709551607 +3 * 18446744073709551614 = 18446744073709551610 +3 * 18446744073709551615 = 18446744073709551613 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 18446744073709551613 = 3 +negate 18446744073709551614 = 2 +negate 18446744073709551615 = 1 +negate 0 = 0 +negate 1 = 18446744073709551615 +negate 2 = 18446744073709551614 +negate 3 = 18446744073709551613 +# +testReal +toRational 18446744073709551613 = 18446744073709551613 % 1 +toRational 18446744073709551614 = 18446744073709551614 % 1 +toRational 18446744073709551615 = 18446744073709551615 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +18446744073709551613 `divMod` 18446744073709551613 = (1,0) +18446744073709551613 `divMod` 18446744073709551614 = (0,18446744073709551613) +18446744073709551613 `divMod` 18446744073709551615 = (0,18446744073709551613) +18446744073709551613 `divMod` 0 = divide by zero +18446744073709551613 `divMod` 1 = (18446744073709551613,0) +18446744073709551613 `divMod` 2 = (9223372036854775806,1) +18446744073709551613 `divMod` 3 = (6148914691236517204,1) + +18446744073709551614 `divMod` 18446744073709551613 = (1,1) +18446744073709551614 `divMod` 18446744073709551614 = (1,0) +18446744073709551614 `divMod` 18446744073709551615 = (0,18446744073709551614) +18446744073709551614 `divMod` 0 = divide by zero +18446744073709551614 `divMod` 1 = (18446744073709551614,0) +18446744073709551614 `divMod` 2 = (9223372036854775807,0) +18446744073709551614 `divMod` 3 = (6148914691236517204,2) + +18446744073709551615 `divMod` 18446744073709551613 = (1,2) +18446744073709551615 `divMod` 18446744073709551614 = (1,1) +18446744073709551615 `divMod` 18446744073709551615 = (1,0) +18446744073709551615 `divMod` 0 = divide by zero +18446744073709551615 `divMod` 1 = (18446744073709551615,0) +18446744073709551615 `divMod` 2 = (9223372036854775807,1) +18446744073709551615 `divMod` 3 = (6148914691236517205,0) + +0 `divMod` 18446744073709551613 = (0,0) +0 `divMod` 18446744073709551614 = (0,0) +0 `divMod` 18446744073709551615 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 18446744073709551613 = (0,1) +1 `divMod` 18446744073709551614 = (0,1) +1 `divMod` 18446744073709551615 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 18446744073709551613 = (0,2) +2 `divMod` 18446744073709551614 = (0,2) +2 `divMod` 18446744073709551615 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 18446744073709551613 = (0,3) +3 `divMod` 18446744073709551614 = (0,3) +3 `divMod` 18446744073709551615 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +18446744073709551613 `div` 18446744073709551613 = 1 +18446744073709551613 `div` 18446744073709551614 = 0 +18446744073709551613 `div` 18446744073709551615 = 0 +18446744073709551613 `div` 0 = divide by zero +18446744073709551613 `div` 1 = 18446744073709551613 +18446744073709551613 `div` 2 = 9223372036854775806 +18446744073709551613 `div` 3 = 6148914691236517204 + +18446744073709551614 `div` 18446744073709551613 = 1 +18446744073709551614 `div` 18446744073709551614 = 1 +18446744073709551614 `div` 18446744073709551615 = 0 +18446744073709551614 `div` 0 = divide by zero +18446744073709551614 `div` 1 = 18446744073709551614 +18446744073709551614 `div` 2 = 9223372036854775807 +18446744073709551614 `div` 3 = 6148914691236517204 + +18446744073709551615 `div` 18446744073709551613 = 1 +18446744073709551615 `div` 18446744073709551614 = 1 +18446744073709551615 `div` 18446744073709551615 = 1 +18446744073709551615 `div` 0 = divide by zero +18446744073709551615 `div` 1 = 18446744073709551615 +18446744073709551615 `div` 2 = 9223372036854775807 +18446744073709551615 `div` 3 = 6148914691236517205 + +0 `div` 18446744073709551613 = 0 +0 `div` 18446744073709551614 = 0 +0 `div` 18446744073709551615 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 18446744073709551613 = 0 +1 `div` 18446744073709551614 = 0 +1 `div` 18446744073709551615 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 18446744073709551613 = 0 +2 `div` 18446744073709551614 = 0 +2 `div` 18446744073709551615 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 18446744073709551613 = 0 +3 `div` 18446744073709551614 = 0 +3 `div` 18446744073709551615 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +18446744073709551613 `mod` 18446744073709551613 = 0 +18446744073709551613 `mod` 18446744073709551614 = 18446744073709551613 +18446744073709551613 `mod` 18446744073709551615 = 18446744073709551613 +18446744073709551613 `mod` 0 = divide by zero +18446744073709551613 `mod` 1 = 0 +18446744073709551613 `mod` 2 = 1 +18446744073709551613 `mod` 3 = 1 + +18446744073709551614 `mod` 18446744073709551613 = 1 +18446744073709551614 `mod` 18446744073709551614 = 0 +18446744073709551614 `mod` 18446744073709551615 = 18446744073709551614 +18446744073709551614 `mod` 0 = divide by zero +18446744073709551614 `mod` 1 = 0 +18446744073709551614 `mod` 2 = 0 +18446744073709551614 `mod` 3 = 2 + +18446744073709551615 `mod` 18446744073709551613 = 2 +18446744073709551615 `mod` 18446744073709551614 = 1 +18446744073709551615 `mod` 18446744073709551615 = 0 +18446744073709551615 `mod` 0 = divide by zero +18446744073709551615 `mod` 1 = 0 +18446744073709551615 `mod` 2 = 1 +18446744073709551615 `mod` 3 = 0 + +0 `mod` 18446744073709551613 = 0 +0 `mod` 18446744073709551614 = 0 +0 `mod` 18446744073709551615 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 18446744073709551613 = 1 +1 `mod` 18446744073709551614 = 1 +1 `mod` 18446744073709551615 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 18446744073709551613 = 2 +2 `mod` 18446744073709551614 = 2 +2 `mod` 18446744073709551615 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 18446744073709551613 = 3 +3 `mod` 18446744073709551614 = 3 +3 `mod` 18446744073709551615 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +18446744073709551613 `quotRem` 18446744073709551613 = (1,0) +18446744073709551613 `quotRem` 18446744073709551614 = (0,18446744073709551613) +18446744073709551613 `quotRem` 18446744073709551615 = (0,18446744073709551613) +18446744073709551613 `quotRem` 0 = divide by zero +18446744073709551613 `quotRem` 1 = (18446744073709551613,0) +18446744073709551613 `quotRem` 2 = (9223372036854775806,1) +18446744073709551613 `quotRem` 3 = (6148914691236517204,1) + +18446744073709551614 `quotRem` 18446744073709551613 = (1,1) +18446744073709551614 `quotRem` 18446744073709551614 = (1,0) +18446744073709551614 `quotRem` 18446744073709551615 = (0,18446744073709551614) +18446744073709551614 `quotRem` 0 = divide by zero +18446744073709551614 `quotRem` 1 = (18446744073709551614,0) +18446744073709551614 `quotRem` 2 = (9223372036854775807,0) +18446744073709551614 `quotRem` 3 = (6148914691236517204,2) + +18446744073709551615 `quotRem` 18446744073709551613 = (1,2) +18446744073709551615 `quotRem` 18446744073709551614 = (1,1) +18446744073709551615 `quotRem` 18446744073709551615 = (1,0) +18446744073709551615 `quotRem` 0 = divide by zero +18446744073709551615 `quotRem` 1 = (18446744073709551615,0) +18446744073709551615 `quotRem` 2 = (9223372036854775807,1) +18446744073709551615 `quotRem` 3 = (6148914691236517205,0) + +0 `quotRem` 18446744073709551613 = (0,0) +0 `quotRem` 18446744073709551614 = (0,0) +0 `quotRem` 18446744073709551615 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 18446744073709551613 = (0,1) +1 `quotRem` 18446744073709551614 = (0,1) +1 `quotRem` 18446744073709551615 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 18446744073709551613 = (0,2) +2 `quotRem` 18446744073709551614 = (0,2) +2 `quotRem` 18446744073709551615 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 18446744073709551613 = (0,3) +3 `quotRem` 18446744073709551614 = (0,3) +3 `quotRem` 18446744073709551615 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +18446744073709551613 `quot` 18446744073709551613 = 1 +18446744073709551613 `quot` 18446744073709551614 = 0 +18446744073709551613 `quot` 18446744073709551615 = 0 +18446744073709551613 `quot` 0 = divide by zero +18446744073709551613 `quot` 1 = 18446744073709551613 +18446744073709551613 `quot` 2 = 9223372036854775806 +18446744073709551613 `quot` 3 = 6148914691236517204 + +18446744073709551614 `quot` 18446744073709551613 = 1 +18446744073709551614 `quot` 18446744073709551614 = 1 +18446744073709551614 `quot` 18446744073709551615 = 0 +18446744073709551614 `quot` 0 = divide by zero +18446744073709551614 `quot` 1 = 18446744073709551614 +18446744073709551614 `quot` 2 = 9223372036854775807 +18446744073709551614 `quot` 3 = 6148914691236517204 + +18446744073709551615 `quot` 18446744073709551613 = 1 +18446744073709551615 `quot` 18446744073709551614 = 1 +18446744073709551615 `quot` 18446744073709551615 = 1 +18446744073709551615 `quot` 0 = divide by zero +18446744073709551615 `quot` 1 = 18446744073709551615 +18446744073709551615 `quot` 2 = 9223372036854775807 +18446744073709551615 `quot` 3 = 6148914691236517205 + +0 `quot` 18446744073709551613 = 0 +0 `quot` 18446744073709551614 = 0 +0 `quot` 18446744073709551615 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 18446744073709551613 = 0 +1 `quot` 18446744073709551614 = 0 +1 `quot` 18446744073709551615 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 18446744073709551613 = 0 +2 `quot` 18446744073709551614 = 0 +2 `quot` 18446744073709551615 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 18446744073709551613 = 0 +3 `quot` 18446744073709551614 = 0 +3 `quot` 18446744073709551615 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +18446744073709551613 `rem` 18446744073709551613 = 0 +18446744073709551613 `rem` 18446744073709551614 = 18446744073709551613 +18446744073709551613 `rem` 18446744073709551615 = 18446744073709551613 +18446744073709551613 `rem` 0 = divide by zero +18446744073709551613 `rem` 1 = 0 +18446744073709551613 `rem` 2 = 1 +18446744073709551613 `rem` 3 = 1 + +18446744073709551614 `rem` 18446744073709551613 = 1 +18446744073709551614 `rem` 18446744073709551614 = 0 +18446744073709551614 `rem` 18446744073709551615 = 18446744073709551614 +18446744073709551614 `rem` 0 = divide by zero +18446744073709551614 `rem` 1 = 0 +18446744073709551614 `rem` 2 = 0 +18446744073709551614 `rem` 3 = 2 + +18446744073709551615 `rem` 18446744073709551613 = 2 +18446744073709551615 `rem` 18446744073709551614 = 1 +18446744073709551615 `rem` 18446744073709551615 = 0 +18446744073709551615 `rem` 0 = divide by zero +18446744073709551615 `rem` 1 = 0 +18446744073709551615 `rem` 2 = 1 +18446744073709551615 `rem` 3 = 0 + +0 `rem` 18446744073709551613 = 0 +0 `rem` 18446744073709551614 = 0 +0 `rem` 18446744073709551615 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 18446744073709551613 = 1 +1 `rem` 18446744073709551614 = 1 +1 `rem` 18446744073709551615 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 18446744073709551613 = 2 +2 `rem` 18446744073709551614 = 2 +2 `rem` 18446744073709551615 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 18446744073709551613 = 3 +3 `rem` 18446744073709551614 = 3 +3 `rem` 18446744073709551615 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,18446744073709551615] +Int : [0,0,-1] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [0,0,-1] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [0,0,18446744073709551615] +testBits +18446744073709551613 .&. 18446744073709551613 = 18446744073709551613 +18446744073709551613 .&. 18446744073709551614 = 18446744073709551612 +18446744073709551613 .&. 18446744073709551615 = 18446744073709551613 +18446744073709551613 .&. 0 = 0 +18446744073709551613 .&. 1 = 1 +18446744073709551613 .&. 2 = 0 +18446744073709551613 .&. 3 = 1 + +18446744073709551614 .&. 18446744073709551613 = 18446744073709551612 +18446744073709551614 .&. 18446744073709551614 = 18446744073709551614 +18446744073709551614 .&. 18446744073709551615 = 18446744073709551614 +18446744073709551614 .&. 0 = 0 +18446744073709551614 .&. 1 = 0 +18446744073709551614 .&. 2 = 2 +18446744073709551614 .&. 3 = 2 + +18446744073709551615 .&. 18446744073709551613 = 18446744073709551613 +18446744073709551615 .&. 18446744073709551614 = 18446744073709551614 +18446744073709551615 .&. 18446744073709551615 = 18446744073709551615 +18446744073709551615 .&. 0 = 0 +18446744073709551615 .&. 1 = 1 +18446744073709551615 .&. 2 = 2 +18446744073709551615 .&. 3 = 3 + +0 .&. 18446744073709551613 = 0 +0 .&. 18446744073709551614 = 0 +0 .&. 18446744073709551615 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 18446744073709551613 = 1 +1 .&. 18446744073709551614 = 0 +1 .&. 18446744073709551615 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 18446744073709551613 = 0 +2 .&. 18446744073709551614 = 2 +2 .&. 18446744073709551615 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 18446744073709551613 = 1 +3 .&. 18446744073709551614 = 2 +3 .&. 18446744073709551615 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +18446744073709551613 .|. 18446744073709551613 = 18446744073709551613 +18446744073709551613 .|. 18446744073709551614 = 18446744073709551615 +18446744073709551613 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551613 .|. 0 = 18446744073709551613 +18446744073709551613 .|. 1 = 18446744073709551613 +18446744073709551613 .|. 2 = 18446744073709551615 +18446744073709551613 .|. 3 = 18446744073709551615 + +18446744073709551614 .|. 18446744073709551613 = 18446744073709551615 +18446744073709551614 .|. 18446744073709551614 = 18446744073709551614 +18446744073709551614 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551614 .|. 0 = 18446744073709551614 +18446744073709551614 .|. 1 = 18446744073709551615 +18446744073709551614 .|. 2 = 18446744073709551614 +18446744073709551614 .|. 3 = 18446744073709551615 + +18446744073709551615 .|. 18446744073709551613 = 18446744073709551615 +18446744073709551615 .|. 18446744073709551614 = 18446744073709551615 +18446744073709551615 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551615 .|. 0 = 18446744073709551615 +18446744073709551615 .|. 1 = 18446744073709551615 +18446744073709551615 .|. 2 = 18446744073709551615 +18446744073709551615 .|. 3 = 18446744073709551615 + +0 .|. 18446744073709551613 = 18446744073709551613 +0 .|. 18446744073709551614 = 18446744073709551614 +0 .|. 18446744073709551615 = 18446744073709551615 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 18446744073709551613 = 18446744073709551613 +1 .|. 18446744073709551614 = 18446744073709551615 +1 .|. 18446744073709551615 = 18446744073709551615 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 18446744073709551613 = 18446744073709551615 +2 .|. 18446744073709551614 = 18446744073709551614 +2 .|. 18446744073709551615 = 18446744073709551615 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 18446744073709551613 = 18446744073709551615 +3 .|. 18446744073709551614 = 18446744073709551615 +3 .|. 18446744073709551615 = 18446744073709551615 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +18446744073709551613 `xor` 18446744073709551613 = 0 +18446744073709551613 `xor` 18446744073709551614 = 3 +18446744073709551613 `xor` 18446744073709551615 = 2 +18446744073709551613 `xor` 0 = 18446744073709551613 +18446744073709551613 `xor` 1 = 18446744073709551612 +18446744073709551613 `xor` 2 = 18446744073709551615 +18446744073709551613 `xor` 3 = 18446744073709551614 + +18446744073709551614 `xor` 18446744073709551613 = 3 +18446744073709551614 `xor` 18446744073709551614 = 0 +18446744073709551614 `xor` 18446744073709551615 = 1 +18446744073709551614 `xor` 0 = 18446744073709551614 +18446744073709551614 `xor` 1 = 18446744073709551615 +18446744073709551614 `xor` 2 = 18446744073709551612 +18446744073709551614 `xor` 3 = 18446744073709551613 + +18446744073709551615 `xor` 18446744073709551613 = 2 +18446744073709551615 `xor` 18446744073709551614 = 1 +18446744073709551615 `xor` 18446744073709551615 = 0 +18446744073709551615 `xor` 0 = 18446744073709551615 +18446744073709551615 `xor` 1 = 18446744073709551614 +18446744073709551615 `xor` 2 = 18446744073709551613 +18446744073709551615 `xor` 3 = 18446744073709551612 + +0 `xor` 18446744073709551613 = 18446744073709551613 +0 `xor` 18446744073709551614 = 18446744073709551614 +0 `xor` 18446744073709551615 = 18446744073709551615 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 18446744073709551613 = 18446744073709551612 +1 `xor` 18446744073709551614 = 18446744073709551615 +1 `xor` 18446744073709551615 = 18446744073709551614 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 18446744073709551613 = 18446744073709551615 +2 `xor` 18446744073709551614 = 18446744073709551612 +2 `xor` 18446744073709551615 = 18446744073709551613 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 18446744073709551613 = 18446744073709551614 +3 `xor` 18446744073709551614 = 18446744073709551613 +3 `xor` 18446744073709551615 = 18446744073709551612 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 18446744073709551613 = 2 +complement 18446744073709551614 = 1 +complement 18446744073709551615 = 0 +complement 0 = 18446744073709551615 +complement 1 = 18446744073709551614 +complement 2 = 18446744073709551613 +complement 3 = 18446744073709551612 +# +18446744073709551613 `shiftL` 0 = 18446744073709551613 +18446744073709551613 `shiftL` 1 = 18446744073709551610 +18446744073709551613 `shiftL` 2 = 18446744073709551604 +18446744073709551613 `shiftL` 3 = 18446744073709551592 +18446744073709551613 `shiftL` 32 = 18446744060824649728 +18446744073709551613 `shiftL` 64 = 0 + +18446744073709551614 `shiftL` 0 = 18446744073709551614 +18446744073709551614 `shiftL` 1 = 18446744073709551612 +18446744073709551614 `shiftL` 2 = 18446744073709551608 +18446744073709551614 `shiftL` 3 = 18446744073709551600 +18446744073709551614 `shiftL` 32 = 18446744065119617024 +18446744073709551614 `shiftL` 64 = 0 + +18446744073709551615 `shiftL` 0 = 18446744073709551615 +18446744073709551615 `shiftL` 1 = 18446744073709551614 +18446744073709551615 `shiftL` 2 = 18446744073709551612 +18446744073709551615 `shiftL` 3 = 18446744073709551608 +18446744073709551615 `shiftL` 32 = 18446744069414584320 +18446744073709551615 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +18446744073709551613 `shiftR` 0 = 18446744073709551613 +18446744073709551613 `shiftR` 1 = 9223372036854775806 +18446744073709551613 `shiftR` 2 = 4611686018427387903 +18446744073709551613 `shiftR` 3 = 2305843009213693951 +18446744073709551613 `shiftR` 32 = 4294967295 +18446744073709551613 `shiftR` 64 = 0 + +18446744073709551614 `shiftR` 0 = 18446744073709551614 +18446744073709551614 `shiftR` 1 = 9223372036854775807 +18446744073709551614 `shiftR` 2 = 4611686018427387903 +18446744073709551614 `shiftR` 3 = 2305843009213693951 +18446744073709551614 `shiftR` 32 = 4294967295 +18446744073709551614 `shiftR` 64 = 0 + +18446744073709551615 `shiftR` 0 = 18446744073709551615 +18446744073709551615 `shiftR` 1 = 9223372036854775807 +18446744073709551615 `shiftR` 2 = 4611686018427387903 +18446744073709551615 `shiftR` 3 = 2305843009213693951 +18446744073709551615 `shiftR` 32 = 4294967295 +18446744073709551615 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +18446744073709551613 `rotate` -3 = 13835058055282163711 +18446744073709551613 `rotate` -2 = 9223372036854775807 +18446744073709551613 `rotate` -1 = 18446744073709551614 +18446744073709551613 `rotate` 0 = 18446744073709551613 +18446744073709551613 `rotate` 1 = 18446744073709551611 +18446744073709551613 `rotate` 2 = 18446744073709551607 +18446744073709551613 `rotate` 3 = 18446744073709551599 +18446744073709551613 `rotate` -64 = 18446744073709551613 +18446744073709551613 `rotate` -32 = 18446744065119617023 +18446744073709551613 `rotate` 32 = 18446744065119617023 +18446744073709551613 `rotate` 64 = 18446744073709551613 + +18446744073709551614 `rotate` -3 = 16140901064495857663 +18446744073709551614 `rotate` -2 = 13835058055282163711 +18446744073709551614 `rotate` -1 = 9223372036854775807 +18446744073709551614 `rotate` 0 = 18446744073709551614 +18446744073709551614 `rotate` 1 = 18446744073709551613 +18446744073709551614 `rotate` 2 = 18446744073709551611 +18446744073709551614 `rotate` 3 = 18446744073709551607 +18446744073709551614 `rotate` -64 = 18446744073709551614 +18446744073709551614 `rotate` -32 = 18446744069414584319 +18446744073709551614 `rotate` 32 = 18446744069414584319 +18446744073709551614 `rotate` 64 = 18446744073709551614 + +18446744073709551615 `rotate` -3 = 18446744073709551615 +18446744073709551615 `rotate` -2 = 18446744073709551615 +18446744073709551615 `rotate` -1 = 18446744073709551615 +18446744073709551615 `rotate` 0 = 18446744073709551615 +18446744073709551615 `rotate` 1 = 18446744073709551615 +18446744073709551615 `rotate` 2 = 18446744073709551615 +18446744073709551615 `rotate` 3 = 18446744073709551615 +18446744073709551615 `rotate` -64 = 18446744073709551615 +18446744073709551615 `rotate` -32 = 18446744073709551615 +18446744073709551615 `rotate` 32 = 18446744073709551615 +18446744073709551615 `rotate` 64 = 18446744073709551615 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = 9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 4294967296 +1 `rotate` 32 = 4294967296 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = 9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 8589934592 +2 `rotate` 32 = 8589934592 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = 13835058055282163712 +3 `rotate` -1 = 9223372036854775809 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 12884901888 +3 `rotate` 32 = 12884901888 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +18446744073709551613 `setBit` 0 = 18446744073709551613 +18446744073709551613 `setBit` 1 = 18446744073709551615 +18446744073709551613 `setBit` 2 = 18446744073709551613 +18446744073709551613 `setBit` 3 = 18446744073709551613 +18446744073709551613 `setBit` 32 = 18446744073709551613 +18446744073709551613 `setBit` 64 = 18446744073709551613 + +18446744073709551614 `setBit` 0 = 18446744073709551615 +18446744073709551614 `setBit` 1 = 18446744073709551614 +18446744073709551614 `setBit` 2 = 18446744073709551614 +18446744073709551614 `setBit` 3 = 18446744073709551614 +18446744073709551614 `setBit` 32 = 18446744073709551614 +18446744073709551614 `setBit` 64 = 18446744073709551614 + +18446744073709551615 `setBit` 0 = 18446744073709551615 +18446744073709551615 `setBit` 1 = 18446744073709551615 +18446744073709551615 `setBit` 2 = 18446744073709551615 +18446744073709551615 `setBit` 3 = 18446744073709551615 +18446744073709551615 `setBit` 32 = 18446744073709551615 +18446744073709551615 `setBit` 64 = 18446744073709551615 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +18446744073709551613 `clearBit` 0 = 18446744073709551612 +18446744073709551613 `clearBit` 1 = 18446744073709551613 +18446744073709551613 `clearBit` 2 = 18446744073709551609 +18446744073709551613 `clearBit` 3 = 18446744073709551605 +18446744073709551613 `clearBit` 32 = 18446744069414584317 +18446744073709551613 `clearBit` 64 = 18446744073709551613 + +18446744073709551614 `clearBit` 0 = 18446744073709551614 +18446744073709551614 `clearBit` 1 = 18446744073709551612 +18446744073709551614 `clearBit` 2 = 18446744073709551610 +18446744073709551614 `clearBit` 3 = 18446744073709551606 +18446744073709551614 `clearBit` 32 = 18446744069414584318 +18446744073709551614 `clearBit` 64 = 18446744073709551614 + +18446744073709551615 `clearBit` 0 = 18446744073709551614 +18446744073709551615 `clearBit` 1 = 18446744073709551613 +18446744073709551615 `clearBit` 2 = 18446744073709551611 +18446744073709551615 `clearBit` 3 = 18446744073709551607 +18446744073709551615 `clearBit` 32 = 18446744069414584319 +18446744073709551615 `clearBit` 64 = 18446744073709551615 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +18446744073709551613 `complementBit` 0 = 18446744073709551612 +18446744073709551613 `complementBit` 1 = 18446744073709551615 +18446744073709551613 `complementBit` 2 = 18446744073709551609 +18446744073709551613 `complementBit` 3 = 18446744073709551605 +18446744073709551613 `complementBit` 32 = 18446744069414584317 +18446744073709551613 `complementBit` 64 = 18446744073709551613 + +18446744073709551614 `complementBit` 0 = 18446744073709551615 +18446744073709551614 `complementBit` 1 = 18446744073709551612 +18446744073709551614 `complementBit` 2 = 18446744073709551610 +18446744073709551614 `complementBit` 3 = 18446744073709551606 +18446744073709551614 `complementBit` 32 = 18446744069414584318 +18446744073709551614 `complementBit` 64 = 18446744073709551614 + +18446744073709551615 `complementBit` 0 = 18446744073709551614 +18446744073709551615 `complementBit` 1 = 18446744073709551613 +18446744073709551615 `complementBit` 2 = 18446744073709551611 +18446744073709551615 `complementBit` 3 = 18446744073709551607 +18446744073709551615 `complementBit` 32 = 18446744069414584319 +18446744073709551615 `complementBit` 64 = 18446744073709551615 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +18446744073709551613 `testBit` 0 = True +18446744073709551613 `testBit` 1 = False +18446744073709551613 `testBit` 2 = True +18446744073709551613 `testBit` 3 = True +18446744073709551613 `testBit` 32 = True +18446744073709551613 `testBit` 64 = False + +18446744073709551614 `testBit` 0 = False +18446744073709551614 `testBit` 1 = True +18446744073709551614 `testBit` 2 = True +18446744073709551614 `testBit` 3 = True +18446744073709551614 `testBit` 32 = True +18446744073709551614 `testBit` 64 = False + +18446744073709551615 `testBit` 0 = True +18446744073709551615 `testBit` 1 = True +18446744073709551615 `testBit` 2 = True +18446744073709551615 `testBit` 3 = True +18446744073709551615 `testBit` 32 = True +18446744073709551615 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 18446744073709551613 = 64 +bitSize 18446744073709551614 = 64 +bitSize 18446744073709551615 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned 18446744073709551613 = False +isSigned 18446744073709551614 = False +isSigned 18446744073709551615 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Integer +-------------------------------- +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = -55340232221128654848 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = -36893488147419103232 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = -18446744073709551616 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 18446744073709551616 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 36893488147419103232 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 55340232221128654848 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -1 +-3 `rotate` -2 = -1 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -6 +-3 `rotate` 2 = -12 +-3 `rotate` 3 = -24 +-3 `rotate` -64 = -1 +-3 `rotate` -32 = -1 +-3 `rotate` 32 = -12884901888 +-3 `rotate` 64 = -55340232221128654848 + +-2 `rotate` -3 = -1 +-2 `rotate` -2 = -1 +-2 `rotate` -1 = -1 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -4 +-2 `rotate` 2 = -8 +-2 `rotate` 3 = -16 +-2 `rotate` -64 = -1 +-2 `rotate` -32 = -1 +-2 `rotate` 32 = -8589934592 +-2 `rotate` 64 = -36893488147419103232 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -2 +-1 `rotate` 2 = -4 +-1 `rotate` 3 = -8 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -4294967296 +-1 `rotate` 64 = -18446744073709551616 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 0 +1 `rotate` -2 = 0 +1 `rotate` -1 = 0 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 0 +1 `rotate` -32 = 0 +1 `rotate` 32 = 4294967296 +1 `rotate` 64 = 18446744073709551616 + +2 `rotate` -3 = 0 +2 `rotate` -2 = 0 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 0 +2 `rotate` -32 = 0 +2 `rotate` 32 = 8589934592 +2 `rotate` 64 = 36893488147419103232 + +3 `rotate` -3 = 0 +3 `rotate` -2 = 0 +3 `rotate` -1 = 1 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 0 +3 `rotate` -32 = 0 +3 `rotate` 32 = 12884901888 +3 `rotate` 64 = 55340232221128654848 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 18446744073709551616 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 18446744073709551617 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 18446744073709551618 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 18446744073709551619 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -18446744073709551619 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -18446744073709551618 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -18446744073709551617 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -18446744073709551619 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -18446744073709551618 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -18446744073709551617 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 18446744073709551616 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 18446744073709551617 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 18446744073709551618 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 18446744073709551619 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = True + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = True + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = True + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# diff --git a/testsuite/tests/numeric/should_run/arith011.stdout-alpha-dec-osf3 b/testsuite/tests/numeric/should_run/arith011.stdout-alpha-dec-osf3 new file mode 100644 index 0000000000..c6c1fd04e4 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith011.stdout-alpha-dec-osf3 @@ -0,0 +1,14508 @@ +-------------------------------- +--Testing Int +-------------------------------- +testBounded +(9223372036854775807,-9223372036854775808,-9223372036854775807) +(9223372036854775806,9223372036854775807,-9223372036854775808) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-9223372036854775808,0,9223372036854775807] +Int : [-9223372036854775808,0,9223372036854775807] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [-9223372036854775808,0,9223372036854775807] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [9223372036854775808,0,9223372036854775807] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -4611686018427387905 +-3 `rotate` -2 = 9223372036854775807 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 + +-2 `rotate` -3 = -2305843009213693953 +-2 `rotate` -2 = -4611686018427387905 +-2 `rotate` -1 = 9223372036854775807 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = -9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = -9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = -4611686018427387904 +3 `rotate` -1 = -9223372036854775807 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 64 +bitSize -2 = 64 +bitSize -1 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int8 +-------------------------------- +testBounded +(127,-128,-127) +(126,127,-128) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-128,0,127] +Int : [-128,0,127] +Int8 : [-128,0,127] +Int16 : [-128,0,127] +Int32 : [-128,0,127] +Int64 : [-128,0,127] +Word8 : [128,0,127] +Word16 : [65408,0,127] +Word32 : [4294967168,0,127] +Word64 : [18446744073709551488,0,127] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -65 +-3 `rotate` -2 = 127 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 + +-2 `rotate` -3 = -33 +-2 `rotate` -2 = -65 +-2 `rotate` -1 = 127 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 32 +1 `rotate` -2 = 64 +1 `rotate` -1 = -128 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 64 +2 `rotate` -2 = -128 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 96 +3 `rotate` -2 = -64 +3 `rotate` -1 = -127 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 8 +bitSize -2 = 8 +bitSize -1 = 8 +bitSize 0 = 8 +bitSize 1 = 8 +bitSize 2 = 8 +bitSize 3 = 8 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int16 +-------------------------------- +testBounded +(32767,-32768,-32767) +(32766,32767,-32768) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-32768,0,32767] +Int : [-32768,0,32767] +Int8 : [0,0,-1] +Int16 : [-32768,0,32767] +Int32 : [-32768,0,32767] +Int64 : [-32768,0,32767] +Word8 : [0,0,255] +Word16 : [32768,0,32767] +Word32 : [4294934528,0,32767] +Word64 : [18446744073709518848,0,32767] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -16385 +-3 `rotate` -2 = 32767 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 + +-2 `rotate` -3 = -8193 +-2 `rotate` -2 = -16385 +-2 `rotate` -1 = 32767 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 8192 +1 `rotate` -2 = 16384 +1 `rotate` -1 = -32768 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 16384 +2 `rotate` -2 = -32768 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 24576 +3 `rotate` -2 = -16384 +3 `rotate` -1 = -32767 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 16 +bitSize -2 = 16 +bitSize -1 = 16 +bitSize 0 = 16 +bitSize 1 = 16 +bitSize 2 = 16 +bitSize 3 = 16 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int32 +-------------------------------- +testBounded +(2147483647,-2147483648,-2147483647) +(2147483646,2147483647,-2147483648) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-2147483648,0,2147483647] +Int : [-2147483648,0,2147483647] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [-2147483648,0,2147483647] +Int64 : [-2147483648,0,2147483647] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [2147483648,0,2147483647] +Word64 : [18446744071562067968,0,2147483647] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -1073741825 +-3 `rotate` -2 = 2147483647 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 + +-2 `rotate` -3 = -536870913 +-2 `rotate` -2 = -1073741825 +-2 `rotate` -1 = 2147483647 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 536870912 +1 `rotate` -2 = 1073741824 +1 `rotate` -1 = -2147483648 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 1073741824 +2 `rotate` -2 = -2147483648 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 1610612736 +3 `rotate` -2 = -1073741824 +3 `rotate` -1 = -2147483647 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 32 +bitSize -2 = 32 +bitSize -1 = 32 +bitSize 0 = 32 +bitSize 1 = 32 +bitSize 2 = 32 +bitSize 3 = 32 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int64 +-------------------------------- +testBounded +(9223372036854775807,-9223372036854775808,-9223372036854775807) +(9223372036854775806,9223372036854775807,-9223372036854775808) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-9223372036854775808,0,9223372036854775807] +Int : [-9223372036854775808,0,9223372036854775807] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [-9223372036854775808,0,9223372036854775807] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [9223372036854775808,0,9223372036854775807] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -4611686018427387905 +-3 `rotate` -2 = 9223372036854775807 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 + +-2 `rotate` -3 = -2305843009213693953 +-2 `rotate` -2 = -4611686018427387905 +-2 `rotate` -1 = 9223372036854775807 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = -9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = -9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = -4611686018427387904 +3 `rotate` -1 = -9223372036854775807 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 64 +bitSize -2 = 64 +bitSize -1 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Word8 +-------------------------------- +testBounded +(255,0,1) +(254,255,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[253,254,255,0,1,2,3] +[253,254,255,0,1,2,3] +testEq +253 == 253 = True +253 == 254 = False +253 == 255 = False +253 == 0 = False +253 == 1 = False +253 == 2 = False +253 == 3 = False + +254 == 253 = False +254 == 254 = True +254 == 255 = False +254 == 0 = False +254 == 1 = False +254 == 2 = False +254 == 3 = False + +255 == 253 = False +255 == 254 = False +255 == 255 = True +255 == 0 = False +255 == 1 = False +255 == 2 = False +255 == 3 = False + +0 == 253 = False +0 == 254 = False +0 == 255 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 253 = False +1 == 254 = False +1 == 255 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 253 = False +2 == 254 = False +2 == 255 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 253 = False +3 == 254 = False +3 == 255 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +253 /= 253 = False +253 /= 254 = True +253 /= 255 = True +253 /= 0 = True +253 /= 1 = True +253 /= 2 = True +253 /= 3 = True + +254 /= 253 = True +254 /= 254 = False +254 /= 255 = True +254 /= 0 = True +254 /= 1 = True +254 /= 2 = True +254 /= 3 = True + +255 /= 253 = True +255 /= 254 = True +255 /= 255 = False +255 /= 0 = True +255 /= 1 = True +255 /= 2 = True +255 /= 3 = True + +0 /= 253 = True +0 /= 254 = True +0 /= 255 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 253 = True +1 /= 254 = True +1 /= 255 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 253 = True +2 /= 254 = True +2 /= 255 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 253 = True +3 /= 254 = True +3 /= 255 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +253 <= 253 = True +253 <= 254 = True +253 <= 255 = True +253 <= 0 = False +253 <= 1 = False +253 <= 2 = False +253 <= 3 = False + +254 <= 253 = False +254 <= 254 = True +254 <= 255 = True +254 <= 0 = False +254 <= 1 = False +254 <= 2 = False +254 <= 3 = False + +255 <= 253 = False +255 <= 254 = False +255 <= 255 = True +255 <= 0 = False +255 <= 1 = False +255 <= 2 = False +255 <= 3 = False + +0 <= 253 = True +0 <= 254 = True +0 <= 255 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 253 = True +1 <= 254 = True +1 <= 255 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 253 = True +2 <= 254 = True +2 <= 255 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 253 = True +3 <= 254 = True +3 <= 255 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +253 < 253 = False +253 < 254 = True +253 < 255 = True +253 < 0 = False +253 < 1 = False +253 < 2 = False +253 < 3 = False + +254 < 253 = False +254 < 254 = False +254 < 255 = True +254 < 0 = False +254 < 1 = False +254 < 2 = False +254 < 3 = False + +255 < 253 = False +255 < 254 = False +255 < 255 = False +255 < 0 = False +255 < 1 = False +255 < 2 = False +255 < 3 = False + +0 < 253 = True +0 < 254 = True +0 < 255 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 253 = True +1 < 254 = True +1 < 255 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 253 = True +2 < 254 = True +2 < 255 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 253 = True +3 < 254 = True +3 < 255 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +253 > 253 = False +253 > 254 = False +253 > 255 = False +253 > 0 = True +253 > 1 = True +253 > 2 = True +253 > 3 = True + +254 > 253 = True +254 > 254 = False +254 > 255 = False +254 > 0 = True +254 > 1 = True +254 > 2 = True +254 > 3 = True + +255 > 253 = True +255 > 254 = True +255 > 255 = False +255 > 0 = True +255 > 1 = True +255 > 2 = True +255 > 3 = True + +0 > 253 = False +0 > 254 = False +0 > 255 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 253 = False +1 > 254 = False +1 > 255 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 253 = False +2 > 254 = False +2 > 255 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 253 = False +3 > 254 = False +3 > 255 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +253 >= 253 = True +253 >= 254 = False +253 >= 255 = False +253 >= 0 = True +253 >= 1 = True +253 >= 2 = True +253 >= 3 = True + +254 >= 253 = True +254 >= 254 = True +254 >= 255 = False +254 >= 0 = True +254 >= 1 = True +254 >= 2 = True +254 >= 3 = True + +255 >= 253 = True +255 >= 254 = True +255 >= 255 = True +255 >= 0 = True +255 >= 1 = True +255 >= 2 = True +255 >= 3 = True + +0 >= 253 = False +0 >= 254 = False +0 >= 255 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 253 = False +1 >= 254 = False +1 >= 255 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 253 = False +2 >= 254 = False +2 >= 255 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 253 = False +3 >= 254 = False +3 >= 255 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +253 `compare` 253 = EQ +253 `compare` 254 = LT +253 `compare` 255 = LT +253 `compare` 0 = GT +253 `compare` 1 = GT +253 `compare` 2 = GT +253 `compare` 3 = GT + +254 `compare` 253 = GT +254 `compare` 254 = EQ +254 `compare` 255 = LT +254 `compare` 0 = GT +254 `compare` 1 = GT +254 `compare` 2 = GT +254 `compare` 3 = GT + +255 `compare` 253 = GT +255 `compare` 254 = GT +255 `compare` 255 = EQ +255 `compare` 0 = GT +255 `compare` 1 = GT +255 `compare` 2 = GT +255 `compare` 3 = GT + +0 `compare` 253 = LT +0 `compare` 254 = LT +0 `compare` 255 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 253 = LT +1 `compare` 254 = LT +1 `compare` 255 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 253 = LT +2 `compare` 254 = LT +2 `compare` 255 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 253 = LT +3 `compare` 254 = LT +3 `compare` 255 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +253 + 253 = 250 +253 + 254 = 251 +253 + 255 = 252 +253 + 0 = 253 +253 + 1 = 254 +253 + 2 = 255 +253 + 3 = 0 + +254 + 253 = 251 +254 + 254 = 252 +254 + 255 = 253 +254 + 0 = 254 +254 + 1 = 255 +254 + 2 = 0 +254 + 3 = 1 + +255 + 253 = 252 +255 + 254 = 253 +255 + 255 = 254 +255 + 0 = 255 +255 + 1 = 0 +255 + 2 = 1 +255 + 3 = 2 + +0 + 253 = 253 +0 + 254 = 254 +0 + 255 = 255 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 253 = 254 +1 + 254 = 255 +1 + 255 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 253 = 255 +2 + 254 = 0 +2 + 255 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 253 = 0 +3 + 254 = 1 +3 + 255 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +253 - 253 = 0 +253 - 254 = 255 +253 - 255 = 254 +253 - 0 = 253 +253 - 1 = 252 +253 - 2 = 251 +253 - 3 = 250 + +254 - 253 = 1 +254 - 254 = 0 +254 - 255 = 255 +254 - 0 = 254 +254 - 1 = 253 +254 - 2 = 252 +254 - 3 = 251 + +255 - 253 = 2 +255 - 254 = 1 +255 - 255 = 0 +255 - 0 = 255 +255 - 1 = 254 +255 - 2 = 253 +255 - 3 = 252 + +0 - 253 = 3 +0 - 254 = 2 +0 - 255 = 1 +0 - 0 = 0 +0 - 1 = 255 +0 - 2 = 254 +0 - 3 = 253 + +1 - 253 = 4 +1 - 254 = 3 +1 - 255 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 255 +1 - 3 = 254 + +2 - 253 = 5 +2 - 254 = 4 +2 - 255 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 255 + +3 - 253 = 6 +3 - 254 = 5 +3 - 255 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +253 * 253 = 9 +253 * 254 = 6 +253 * 255 = 3 +253 * 0 = 0 +253 * 1 = 253 +253 * 2 = 250 +253 * 3 = 247 + +254 * 253 = 6 +254 * 254 = 4 +254 * 255 = 2 +254 * 0 = 0 +254 * 1 = 254 +254 * 2 = 252 +254 * 3 = 250 + +255 * 253 = 3 +255 * 254 = 2 +255 * 255 = 1 +255 * 0 = 0 +255 * 1 = 255 +255 * 2 = 254 +255 * 3 = 253 + +0 * 253 = 0 +0 * 254 = 0 +0 * 255 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 253 = 253 +1 * 254 = 254 +1 * 255 = 255 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 253 = 250 +2 * 254 = 252 +2 * 255 = 254 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 253 = 247 +3 * 254 = 250 +3 * 255 = 253 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 253 = 3 +negate 254 = 2 +negate 255 = 1 +negate 0 = 0 +negate 1 = 255 +negate 2 = 254 +negate 3 = 253 +# +testReal +toRational 253 = 253 % 1 +toRational 254 = 254 % 1 +toRational 255 = 255 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +253 `divMod` 253 = (1,0) +253 `divMod` 254 = (0,253) +253 `divMod` 255 = (0,253) +253 `divMod` 1 = (253,0) +253 `divMod` 2 = (126,1) +253 `divMod` 3 = (84,1) + +254 `divMod` 253 = (1,1) +254 `divMod` 254 = (1,0) +254 `divMod` 255 = (0,254) +254 `divMod` 1 = (254,0) +254 `divMod` 2 = (127,0) +254 `divMod` 3 = (84,2) + +255 `divMod` 253 = (1,2) +255 `divMod` 254 = (1,1) +255 `divMod` 255 = (1,0) +255 `divMod` 1 = (255,0) +255 `divMod` 2 = (127,1) +255 `divMod` 3 = (85,0) + +0 `divMod` 253 = (0,0) +0 `divMod` 254 = (0,0) +0 `divMod` 255 = (0,0) +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 253 = (0,1) +1 `divMod` 254 = (0,1) +1 `divMod` 255 = (0,1) +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 253 = (0,2) +2 `divMod` 254 = (0,2) +2 `divMod` 255 = (0,2) +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 253 = (0,3) +3 `divMod` 254 = (0,3) +3 `divMod` 255 = (0,3) +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +253 `div` 253 = 1 +253 `div` 254 = 0 +253 `div` 255 = 0 +253 `div` 1 = 253 +253 `div` 2 = 126 +253 `div` 3 = 84 + +254 `div` 253 = 1 +254 `div` 254 = 1 +254 `div` 255 = 0 +254 `div` 1 = 254 +254 `div` 2 = 127 +254 `div` 3 = 84 + +255 `div` 253 = 1 +255 `div` 254 = 1 +255 `div` 255 = 1 +255 `div` 1 = 255 +255 `div` 2 = 127 +255 `div` 3 = 85 + +0 `div` 253 = 0 +0 `div` 254 = 0 +0 `div` 255 = 0 +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 253 = 0 +1 `div` 254 = 0 +1 `div` 255 = 0 +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 253 = 0 +2 `div` 254 = 0 +2 `div` 255 = 0 +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 253 = 0 +3 `div` 254 = 0 +3 `div` 255 = 0 +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +253 `mod` 253 = 0 +253 `mod` 254 = 253 +253 `mod` 255 = 253 +253 `mod` 1 = 0 +253 `mod` 2 = 1 +253 `mod` 3 = 1 + +254 `mod` 253 = 1 +254 `mod` 254 = 0 +254 `mod` 255 = 254 +254 `mod` 1 = 0 +254 `mod` 2 = 0 +254 `mod` 3 = 2 + +255 `mod` 253 = 2 +255 `mod` 254 = 1 +255 `mod` 255 = 0 +255 `mod` 1 = 0 +255 `mod` 2 = 1 +255 `mod` 3 = 0 + +0 `mod` 253 = 0 +0 `mod` 254 = 0 +0 `mod` 255 = 0 +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 253 = 1 +1 `mod` 254 = 1 +1 `mod` 255 = 1 +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 253 = 2 +2 `mod` 254 = 2 +2 `mod` 255 = 2 +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 253 = 3 +3 `mod` 254 = 3 +3 `mod` 255 = 3 +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +253 `quotRem` 253 = (1,0) +253 `quotRem` 254 = (0,253) +253 `quotRem` 255 = (0,253) +253 `quotRem` 1 = (253,0) +253 `quotRem` 2 = (126,1) +253 `quotRem` 3 = (84,1) + +254 `quotRem` 253 = (1,1) +254 `quotRem` 254 = (1,0) +254 `quotRem` 255 = (0,254) +254 `quotRem` 1 = (254,0) +254 `quotRem` 2 = (127,0) +254 `quotRem` 3 = (84,2) + +255 `quotRem` 253 = (1,2) +255 `quotRem` 254 = (1,1) +255 `quotRem` 255 = (1,0) +255 `quotRem` 1 = (255,0) +255 `quotRem` 2 = (127,1) +255 `quotRem` 3 = (85,0) + +0 `quotRem` 253 = (0,0) +0 `quotRem` 254 = (0,0) +0 `quotRem` 255 = (0,0) +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 253 = (0,1) +1 `quotRem` 254 = (0,1) +1 `quotRem` 255 = (0,1) +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 253 = (0,2) +2 `quotRem` 254 = (0,2) +2 `quotRem` 255 = (0,2) +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 253 = (0,3) +3 `quotRem` 254 = (0,3) +3 `quotRem` 255 = (0,3) +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +253 `quot` 253 = 1 +253 `quot` 254 = 0 +253 `quot` 255 = 0 +253 `quot` 1 = 253 +253 `quot` 2 = 126 +253 `quot` 3 = 84 + +254 `quot` 253 = 1 +254 `quot` 254 = 1 +254 `quot` 255 = 0 +254 `quot` 1 = 254 +254 `quot` 2 = 127 +254 `quot` 3 = 84 + +255 `quot` 253 = 1 +255 `quot` 254 = 1 +255 `quot` 255 = 1 +255 `quot` 1 = 255 +255 `quot` 2 = 127 +255 `quot` 3 = 85 + +0 `quot` 253 = 0 +0 `quot` 254 = 0 +0 `quot` 255 = 0 +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 253 = 0 +1 `quot` 254 = 0 +1 `quot` 255 = 0 +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 253 = 0 +2 `quot` 254 = 0 +2 `quot` 255 = 0 +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 253 = 0 +3 `quot` 254 = 0 +3 `quot` 255 = 0 +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +253 `rem` 253 = 0 +253 `rem` 254 = 253 +253 `rem` 255 = 253 +253 `rem` 1 = 0 +253 `rem` 2 = 1 +253 `rem` 3 = 1 + +254 `rem` 253 = 1 +254 `rem` 254 = 0 +254 `rem` 255 = 254 +254 `rem` 1 = 0 +254 `rem` 2 = 0 +254 `rem` 3 = 2 + +255 `rem` 253 = 2 +255 `rem` 254 = 1 +255 `rem` 255 = 0 +255 `rem` 1 = 0 +255 `rem` 2 = 1 +255 `rem` 3 = 0 + +0 `rem` 253 = 0 +0 `rem` 254 = 0 +0 `rem` 255 = 0 +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 253 = 1 +1 `rem` 254 = 1 +1 `rem` 255 = 1 +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 253 = 2 +2 `rem` 254 = 2 +2 `rem` 255 = 2 +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 253 = 3 +3 `rem` 254 = 3 +3 `rem` 255 = 3 +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,255] +Int : [0,0,255] +Int8 : [0,0,-1] +Int16 : [0,0,255] +Int32 : [0,0,255] +Int64 : [0,0,255] +Word8 : [0,0,255] +Word16 : [0,0,255] +Word32 : [0,0,255] +Word64 : [0,0,255] +testBits +253 .&. 253 = 253 +253 .&. 254 = 252 +253 .&. 255 = 253 +253 .&. 1 = 1 +253 .&. 2 = 0 +253 .&. 3 = 1 + +254 .&. 253 = 252 +254 .&. 254 = 254 +254 .&. 255 = 254 +254 .&. 1 = 0 +254 .&. 2 = 2 +254 .&. 3 = 2 + +255 .&. 253 = 253 +255 .&. 254 = 254 +255 .&. 255 = 255 +255 .&. 1 = 1 +255 .&. 2 = 2 +255 .&. 3 = 3 + +0 .&. 253 = 0 +0 .&. 254 = 0 +0 .&. 255 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 253 = 1 +1 .&. 254 = 0 +1 .&. 255 = 1 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 253 = 0 +2 .&. 254 = 2 +2 .&. 255 = 2 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 253 = 1 +3 .&. 254 = 2 +3 .&. 255 = 3 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +253 .|. 253 = 253 +253 .|. 254 = 255 +253 .|. 255 = 255 +253 .|. 1 = 253 +253 .|. 2 = 255 +253 .|. 3 = 255 + +254 .|. 253 = 255 +254 .|. 254 = 254 +254 .|. 255 = 255 +254 .|. 1 = 255 +254 .|. 2 = 254 +254 .|. 3 = 255 + +255 .|. 253 = 255 +255 .|. 254 = 255 +255 .|. 255 = 255 +255 .|. 1 = 255 +255 .|. 2 = 255 +255 .|. 3 = 255 + +0 .|. 253 = 253 +0 .|. 254 = 254 +0 .|. 255 = 255 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 253 = 253 +1 .|. 254 = 255 +1 .|. 255 = 255 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 253 = 255 +2 .|. 254 = 254 +2 .|. 255 = 255 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 253 = 255 +3 .|. 254 = 255 +3 .|. 255 = 255 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +253 `xor` 253 = 0 +253 `xor` 254 = 3 +253 `xor` 255 = 2 +253 `xor` 1 = 252 +253 `xor` 2 = 255 +253 `xor` 3 = 254 + +254 `xor` 253 = 3 +254 `xor` 254 = 0 +254 `xor` 255 = 1 +254 `xor` 1 = 255 +254 `xor` 2 = 252 +254 `xor` 3 = 253 + +255 `xor` 253 = 2 +255 `xor` 254 = 1 +255 `xor` 255 = 0 +255 `xor` 1 = 254 +255 `xor` 2 = 253 +255 `xor` 3 = 252 + +0 `xor` 253 = 253 +0 `xor` 254 = 254 +0 `xor` 255 = 255 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 253 = 252 +1 `xor` 254 = 255 +1 `xor` 255 = 254 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 253 = 255 +2 `xor` 254 = 252 +2 `xor` 255 = 253 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 253 = 254 +3 `xor` 254 = 253 +3 `xor` 255 = 252 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 253 = 2 +complement 254 = 1 +complement 255 = 0 +complement 0 = 255 +complement 1 = 254 +complement 2 = 253 +complement 3 = 252 +# +253 `shiftL` 0 = 253 +253 `shiftL` 1 = 250 +253 `shiftL` 2 = 244 +253 `shiftL` 3 = 232 +253 `shiftL` 32 = 0 +253 `shiftL` 64 = 0 + +254 `shiftL` 0 = 254 +254 `shiftL` 1 = 252 +254 `shiftL` 2 = 248 +254 `shiftL` 3 = 240 +254 `shiftL` 32 = 0 +254 `shiftL` 64 = 0 + +255 `shiftL` 0 = 255 +255 `shiftL` 1 = 254 +255 `shiftL` 2 = 252 +255 `shiftL` 3 = 248 +255 `shiftL` 32 = 0 +255 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +253 `shiftR` 0 = 253 +253 `shiftR` 1 = 126 +253 `shiftR` 2 = 63 +253 `shiftR` 3 = 31 +253 `shiftR` 32 = 0 +253 `shiftR` 64 = 0 + +254 `shiftR` 0 = 254 +254 `shiftR` 1 = 127 +254 `shiftR` 2 = 63 +254 `shiftR` 3 = 31 +254 `shiftR` 32 = 0 +254 `shiftR` 64 = 0 + +255 `shiftR` 0 = 255 +255 `shiftR` 1 = 127 +255 `shiftR` 2 = 63 +255 `shiftR` 3 = 31 +255 `shiftR` 32 = 0 +255 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +253 `rotate` -3 = 191 +253 `rotate` -2 = 127 +253 `rotate` -1 = 254 +253 `rotate` 0 = 253 +253 `rotate` 1 = 251 +253 `rotate` 2 = 247 +253 `rotate` 3 = 239 + +254 `rotate` -3 = 223 +254 `rotate` -2 = 191 +254 `rotate` -1 = 127 +254 `rotate` 0 = 254 +254 `rotate` 1 = 253 +254 `rotate` 2 = 251 +254 `rotate` 3 = 247 + +255 `rotate` -3 = 255 +255 `rotate` -2 = 255 +255 `rotate` -1 = 255 +255 `rotate` 0 = 255 +255 `rotate` 1 = 255 +255 `rotate` 2 = 255 +255 `rotate` 3 = 255 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 32 +1 `rotate` -2 = 64 +1 `rotate` -1 = 128 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 64 +2 `rotate` -2 = 128 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 96 +3 `rotate` -2 = 192 +3 `rotate` -1 = 129 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +253 `setBit` 0 = 253 +253 `setBit` 1 = 255 +253 `setBit` 2 = 253 +253 `setBit` 3 = 253 +253 `setBit` 32 = 253 +253 `setBit` 64 = 253 + +254 `setBit` 0 = 255 +254 `setBit` 1 = 254 +254 `setBit` 2 = 254 +254 `setBit` 3 = 254 +254 `setBit` 32 = 254 +254 `setBit` 64 = 254 + +255 `setBit` 0 = 255 +255 `setBit` 1 = 255 +255 `setBit` 2 = 255 +255 `setBit` 3 = 255 +255 `setBit` 32 = 255 +255 `setBit` 64 = 255 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +253 `clearBit` 0 = 252 +253 `clearBit` 1 = 253 +253 `clearBit` 2 = 249 +253 `clearBit` 3 = 245 +253 `clearBit` 32 = 253 +253 `clearBit` 64 = 253 + +254 `clearBit` 0 = 254 +254 `clearBit` 1 = 252 +254 `clearBit` 2 = 250 +254 `clearBit` 3 = 246 +254 `clearBit` 32 = 254 +254 `clearBit` 64 = 254 + +255 `clearBit` 0 = 254 +255 `clearBit` 1 = 253 +255 `clearBit` 2 = 251 +255 `clearBit` 3 = 247 +255 `clearBit` 32 = 255 +255 `clearBit` 64 = 255 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +253 `complementBit` 0 = 252 +253 `complementBit` 1 = 255 +253 `complementBit` 2 = 249 +253 `complementBit` 3 = 245 +253 `complementBit` 32 = 253 +253 `complementBit` 64 = 253 + +254 `complementBit` 0 = 255 +254 `complementBit` 1 = 252 +254 `complementBit` 2 = 250 +254 `complementBit` 3 = 246 +254 `complementBit` 32 = 254 +254 `complementBit` 64 = 254 + +255 `complementBit` 0 = 254 +255 `complementBit` 1 = 253 +255 `complementBit` 2 = 251 +255 `complementBit` 3 = 247 +255 `complementBit` 32 = 255 +255 `complementBit` 64 = 255 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +253 `testBit` 0 = True +253 `testBit` 1 = False +253 `testBit` 2 = True +253 `testBit` 3 = True +253 `testBit` 32 = False +253 `testBit` 64 = False + +254 `testBit` 0 = False +254 `testBit` 1 = True +254 `testBit` 2 = True +254 `testBit` 3 = True +254 `testBit` 32 = False +254 `testBit` 64 = False + +255 `testBit` 0 = True +255 `testBit` 1 = True +255 `testBit` 2 = True +255 `testBit` 3 = True +255 `testBit` 32 = False +255 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 253 = 8 +bitSize 254 = 8 +bitSize 255 = 8 +bitSize 0 = 8 +bitSize 1 = 8 +bitSize 2 = 8 +bitSize 3 = 8 +# +isSigned 253 = False +isSigned 254 = False +isSigned 255 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word16 +-------------------------------- +testBounded +(65535,0,1) +(65534,65535,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[65533,65534,65535,0,1,2,3] +[65533,65534,65535,0,1,2,3] +testEq +65533 == 65533 = True +65533 == 65534 = False +65533 == 65535 = False +65533 == 0 = False +65533 == 1 = False +65533 == 2 = False +65533 == 3 = False + +65534 == 65533 = False +65534 == 65534 = True +65534 == 65535 = False +65534 == 0 = False +65534 == 1 = False +65534 == 2 = False +65534 == 3 = False + +65535 == 65533 = False +65535 == 65534 = False +65535 == 65535 = True +65535 == 0 = False +65535 == 1 = False +65535 == 2 = False +65535 == 3 = False + +0 == 65533 = False +0 == 65534 = False +0 == 65535 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 65533 = False +1 == 65534 = False +1 == 65535 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 65533 = False +2 == 65534 = False +2 == 65535 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 65533 = False +3 == 65534 = False +3 == 65535 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +65533 /= 65533 = False +65533 /= 65534 = True +65533 /= 65535 = True +65533 /= 0 = True +65533 /= 1 = True +65533 /= 2 = True +65533 /= 3 = True + +65534 /= 65533 = True +65534 /= 65534 = False +65534 /= 65535 = True +65534 /= 0 = True +65534 /= 1 = True +65534 /= 2 = True +65534 /= 3 = True + +65535 /= 65533 = True +65535 /= 65534 = True +65535 /= 65535 = False +65535 /= 0 = True +65535 /= 1 = True +65535 /= 2 = True +65535 /= 3 = True + +0 /= 65533 = True +0 /= 65534 = True +0 /= 65535 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 65533 = True +1 /= 65534 = True +1 /= 65535 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 65533 = True +2 /= 65534 = True +2 /= 65535 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 65533 = True +3 /= 65534 = True +3 /= 65535 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +65533 <= 65533 = True +65533 <= 65534 = True +65533 <= 65535 = True +65533 <= 0 = False +65533 <= 1 = False +65533 <= 2 = False +65533 <= 3 = False + +65534 <= 65533 = False +65534 <= 65534 = True +65534 <= 65535 = True +65534 <= 0 = False +65534 <= 1 = False +65534 <= 2 = False +65534 <= 3 = False + +65535 <= 65533 = False +65535 <= 65534 = False +65535 <= 65535 = True +65535 <= 0 = False +65535 <= 1 = False +65535 <= 2 = False +65535 <= 3 = False + +0 <= 65533 = True +0 <= 65534 = True +0 <= 65535 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 65533 = True +1 <= 65534 = True +1 <= 65535 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 65533 = True +2 <= 65534 = True +2 <= 65535 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 65533 = True +3 <= 65534 = True +3 <= 65535 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +65533 < 65533 = False +65533 < 65534 = True +65533 < 65535 = True +65533 < 0 = False +65533 < 1 = False +65533 < 2 = False +65533 < 3 = False + +65534 < 65533 = False +65534 < 65534 = False +65534 < 65535 = True +65534 < 0 = False +65534 < 1 = False +65534 < 2 = False +65534 < 3 = False + +65535 < 65533 = False +65535 < 65534 = False +65535 < 65535 = False +65535 < 0 = False +65535 < 1 = False +65535 < 2 = False +65535 < 3 = False + +0 < 65533 = True +0 < 65534 = True +0 < 65535 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 65533 = True +1 < 65534 = True +1 < 65535 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 65533 = True +2 < 65534 = True +2 < 65535 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 65533 = True +3 < 65534 = True +3 < 65535 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +65533 > 65533 = False +65533 > 65534 = False +65533 > 65535 = False +65533 > 0 = True +65533 > 1 = True +65533 > 2 = True +65533 > 3 = True + +65534 > 65533 = True +65534 > 65534 = False +65534 > 65535 = False +65534 > 0 = True +65534 > 1 = True +65534 > 2 = True +65534 > 3 = True + +65535 > 65533 = True +65535 > 65534 = True +65535 > 65535 = False +65535 > 0 = True +65535 > 1 = True +65535 > 2 = True +65535 > 3 = True + +0 > 65533 = False +0 > 65534 = False +0 > 65535 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 65533 = False +1 > 65534 = False +1 > 65535 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 65533 = False +2 > 65534 = False +2 > 65535 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 65533 = False +3 > 65534 = False +3 > 65535 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +65533 >= 65533 = True +65533 >= 65534 = False +65533 >= 65535 = False +65533 >= 0 = True +65533 >= 1 = True +65533 >= 2 = True +65533 >= 3 = True + +65534 >= 65533 = True +65534 >= 65534 = True +65534 >= 65535 = False +65534 >= 0 = True +65534 >= 1 = True +65534 >= 2 = True +65534 >= 3 = True + +65535 >= 65533 = True +65535 >= 65534 = True +65535 >= 65535 = True +65535 >= 0 = True +65535 >= 1 = True +65535 >= 2 = True +65535 >= 3 = True + +0 >= 65533 = False +0 >= 65534 = False +0 >= 65535 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 65533 = False +1 >= 65534 = False +1 >= 65535 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 65533 = False +2 >= 65534 = False +2 >= 65535 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 65533 = False +3 >= 65534 = False +3 >= 65535 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +65533 `compare` 65533 = EQ +65533 `compare` 65534 = LT +65533 `compare` 65535 = LT +65533 `compare` 0 = GT +65533 `compare` 1 = GT +65533 `compare` 2 = GT +65533 `compare` 3 = GT + +65534 `compare` 65533 = GT +65534 `compare` 65534 = EQ +65534 `compare` 65535 = LT +65534 `compare` 0 = GT +65534 `compare` 1 = GT +65534 `compare` 2 = GT +65534 `compare` 3 = GT + +65535 `compare` 65533 = GT +65535 `compare` 65534 = GT +65535 `compare` 65535 = EQ +65535 `compare` 0 = GT +65535 `compare` 1 = GT +65535 `compare` 2 = GT +65535 `compare` 3 = GT + +0 `compare` 65533 = LT +0 `compare` 65534 = LT +0 `compare` 65535 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 65533 = LT +1 `compare` 65534 = LT +1 `compare` 65535 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 65533 = LT +2 `compare` 65534 = LT +2 `compare` 65535 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 65533 = LT +3 `compare` 65534 = LT +3 `compare` 65535 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +65533 + 65533 = 65530 +65533 + 65534 = 65531 +65533 + 65535 = 65532 +65533 + 0 = 65533 +65533 + 1 = 65534 +65533 + 2 = 65535 +65533 + 3 = 0 + +65534 + 65533 = 65531 +65534 + 65534 = 65532 +65534 + 65535 = 65533 +65534 + 0 = 65534 +65534 + 1 = 65535 +65534 + 2 = 0 +65534 + 3 = 1 + +65535 + 65533 = 65532 +65535 + 65534 = 65533 +65535 + 65535 = 65534 +65535 + 0 = 65535 +65535 + 1 = 0 +65535 + 2 = 1 +65535 + 3 = 2 + +0 + 65533 = 65533 +0 + 65534 = 65534 +0 + 65535 = 65535 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 65533 = 65534 +1 + 65534 = 65535 +1 + 65535 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 65533 = 65535 +2 + 65534 = 0 +2 + 65535 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 65533 = 0 +3 + 65534 = 1 +3 + 65535 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +65533 - 65533 = 0 +65533 - 65534 = 65535 +65533 - 65535 = 65534 +65533 - 0 = 65533 +65533 - 1 = 65532 +65533 - 2 = 65531 +65533 - 3 = 65530 + +65534 - 65533 = 1 +65534 - 65534 = 0 +65534 - 65535 = 65535 +65534 - 0 = 65534 +65534 - 1 = 65533 +65534 - 2 = 65532 +65534 - 3 = 65531 + +65535 - 65533 = 2 +65535 - 65534 = 1 +65535 - 65535 = 0 +65535 - 0 = 65535 +65535 - 1 = 65534 +65535 - 2 = 65533 +65535 - 3 = 65532 + +0 - 65533 = 3 +0 - 65534 = 2 +0 - 65535 = 1 +0 - 0 = 0 +0 - 1 = 65535 +0 - 2 = 65534 +0 - 3 = 65533 + +1 - 65533 = 4 +1 - 65534 = 3 +1 - 65535 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 65535 +1 - 3 = 65534 + +2 - 65533 = 5 +2 - 65534 = 4 +2 - 65535 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 65535 + +3 - 65533 = 6 +3 - 65534 = 5 +3 - 65535 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +65533 * 65533 = 9 +65533 * 65534 = 6 +65533 * 65535 = 3 +65533 * 0 = 0 +65533 * 1 = 65533 +65533 * 2 = 65530 +65533 * 3 = 65527 + +65534 * 65533 = 6 +65534 * 65534 = 4 +65534 * 65535 = 2 +65534 * 0 = 0 +65534 * 1 = 65534 +65534 * 2 = 65532 +65534 * 3 = 65530 + +65535 * 65533 = 3 +65535 * 65534 = 2 +65535 * 65535 = 1 +65535 * 0 = 0 +65535 * 1 = 65535 +65535 * 2 = 65534 +65535 * 3 = 65533 + +0 * 65533 = 0 +0 * 65534 = 0 +0 * 65535 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 65533 = 65533 +1 * 65534 = 65534 +1 * 65535 = 65535 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 65533 = 65530 +2 * 65534 = 65532 +2 * 65535 = 65534 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 65533 = 65527 +3 * 65534 = 65530 +3 * 65535 = 65533 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 65533 = 3 +negate 65534 = 2 +negate 65535 = 1 +negate 0 = 0 +negate 1 = 65535 +negate 2 = 65534 +negate 3 = 65533 +# +testReal +toRational 65533 = 65533 % 1 +toRational 65534 = 65534 % 1 +toRational 65535 = 65535 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +65533 `divMod` 65533 = (1,0) +65533 `divMod` 65534 = (0,65533) +65533 `divMod` 65535 = (0,65533) +65533 `divMod` 1 = (65533,0) +65533 `divMod` 2 = (32766,1) +65533 `divMod` 3 = (21844,1) + +65534 `divMod` 65533 = (1,1) +65534 `divMod` 65534 = (1,0) +65534 `divMod` 65535 = (0,65534) +65534 `divMod` 1 = (65534,0) +65534 `divMod` 2 = (32767,0) +65534 `divMod` 3 = (21844,2) + +65535 `divMod` 65533 = (1,2) +65535 `divMod` 65534 = (1,1) +65535 `divMod` 65535 = (1,0) +65535 `divMod` 1 = (65535,0) +65535 `divMod` 2 = (32767,1) +65535 `divMod` 3 = (21845,0) + +0 `divMod` 65533 = (0,0) +0 `divMod` 65534 = (0,0) +0 `divMod` 65535 = (0,0) +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 65533 = (0,1) +1 `divMod` 65534 = (0,1) +1 `divMod` 65535 = (0,1) +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 65533 = (0,2) +2 `divMod` 65534 = (0,2) +2 `divMod` 65535 = (0,2) +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 65533 = (0,3) +3 `divMod` 65534 = (0,3) +3 `divMod` 65535 = (0,3) +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +65533 `div` 65533 = 1 +65533 `div` 65534 = 0 +65533 `div` 65535 = 0 +65533 `div` 1 = 65533 +65533 `div` 2 = 32766 +65533 `div` 3 = 21844 + +65534 `div` 65533 = 1 +65534 `div` 65534 = 1 +65534 `div` 65535 = 0 +65534 `div` 1 = 65534 +65534 `div` 2 = 32767 +65534 `div` 3 = 21844 + +65535 `div` 65533 = 1 +65535 `div` 65534 = 1 +65535 `div` 65535 = 1 +65535 `div` 1 = 65535 +65535 `div` 2 = 32767 +65535 `div` 3 = 21845 + +0 `div` 65533 = 0 +0 `div` 65534 = 0 +0 `div` 65535 = 0 +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 65533 = 0 +1 `div` 65534 = 0 +1 `div` 65535 = 0 +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 65533 = 0 +2 `div` 65534 = 0 +2 `div` 65535 = 0 +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 65533 = 0 +3 `div` 65534 = 0 +3 `div` 65535 = 0 +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +65533 `mod` 65533 = 0 +65533 `mod` 65534 = 65533 +65533 `mod` 65535 = 65533 +65533 `mod` 1 = 0 +65533 `mod` 2 = 1 +65533 `mod` 3 = 1 + +65534 `mod` 65533 = 1 +65534 `mod` 65534 = 0 +65534 `mod` 65535 = 65534 +65534 `mod` 1 = 0 +65534 `mod` 2 = 0 +65534 `mod` 3 = 2 + +65535 `mod` 65533 = 2 +65535 `mod` 65534 = 1 +65535 `mod` 65535 = 0 +65535 `mod` 1 = 0 +65535 `mod` 2 = 1 +65535 `mod` 3 = 0 + +0 `mod` 65533 = 0 +0 `mod` 65534 = 0 +0 `mod` 65535 = 0 +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 65533 = 1 +1 `mod` 65534 = 1 +1 `mod` 65535 = 1 +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 65533 = 2 +2 `mod` 65534 = 2 +2 `mod` 65535 = 2 +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 65533 = 3 +3 `mod` 65534 = 3 +3 `mod` 65535 = 3 +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +65533 `quotRem` 65533 = (1,0) +65533 `quotRem` 65534 = (0,65533) +65533 `quotRem` 65535 = (0,65533) +65533 `quotRem` 1 = (65533,0) +65533 `quotRem` 2 = (32766,1) +65533 `quotRem` 3 = (21844,1) + +65534 `quotRem` 65533 = (1,1) +65534 `quotRem` 65534 = (1,0) +65534 `quotRem` 65535 = (0,65534) +65534 `quotRem` 1 = (65534,0) +65534 `quotRem` 2 = (32767,0) +65534 `quotRem` 3 = (21844,2) + +65535 `quotRem` 65533 = (1,2) +65535 `quotRem` 65534 = (1,1) +65535 `quotRem` 65535 = (1,0) +65535 `quotRem` 1 = (65535,0) +65535 `quotRem` 2 = (32767,1) +65535 `quotRem` 3 = (21845,0) + +0 `quotRem` 65533 = (0,0) +0 `quotRem` 65534 = (0,0) +0 `quotRem` 65535 = (0,0) +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 65533 = (0,1) +1 `quotRem` 65534 = (0,1) +1 `quotRem` 65535 = (0,1) +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 65533 = (0,2) +2 `quotRem` 65534 = (0,2) +2 `quotRem` 65535 = (0,2) +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 65533 = (0,3) +3 `quotRem` 65534 = (0,3) +3 `quotRem` 65535 = (0,3) +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +65533 `quot` 65533 = 1 +65533 `quot` 65534 = 0 +65533 `quot` 65535 = 0 +65533 `quot` 1 = 65533 +65533 `quot` 2 = 32766 +65533 `quot` 3 = 21844 + +65534 `quot` 65533 = 1 +65534 `quot` 65534 = 1 +65534 `quot` 65535 = 0 +65534 `quot` 1 = 65534 +65534 `quot` 2 = 32767 +65534 `quot` 3 = 21844 + +65535 `quot` 65533 = 1 +65535 `quot` 65534 = 1 +65535 `quot` 65535 = 1 +65535 `quot` 1 = 65535 +65535 `quot` 2 = 32767 +65535 `quot` 3 = 21845 + +0 `quot` 65533 = 0 +0 `quot` 65534 = 0 +0 `quot` 65535 = 0 +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 65533 = 0 +1 `quot` 65534 = 0 +1 `quot` 65535 = 0 +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 65533 = 0 +2 `quot` 65534 = 0 +2 `quot` 65535 = 0 +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 65533 = 0 +3 `quot` 65534 = 0 +3 `quot` 65535 = 0 +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +65533 `rem` 65533 = 0 +65533 `rem` 65534 = 65533 +65533 `rem` 65535 = 65533 +65533 `rem` 1 = 0 +65533 `rem` 2 = 1 +65533 `rem` 3 = 1 + +65534 `rem` 65533 = 1 +65534 `rem` 65534 = 0 +65534 `rem` 65535 = 65534 +65534 `rem` 1 = 0 +65534 `rem` 2 = 0 +65534 `rem` 3 = 2 + +65535 `rem` 65533 = 2 +65535 `rem` 65534 = 1 +65535 `rem` 65535 = 0 +65535 `rem` 1 = 0 +65535 `rem` 2 = 1 +65535 `rem` 3 = 0 + +0 `rem` 65533 = 0 +0 `rem` 65534 = 0 +0 `rem` 65535 = 0 +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 65533 = 1 +1 `rem` 65534 = 1 +1 `rem` 65535 = 1 +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 65533 = 2 +2 `rem` 65534 = 2 +2 `rem` 65535 = 2 +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 65533 = 3 +3 `rem` 65534 = 3 +3 `rem` 65535 = 3 +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,65535] +Int : [0,0,65535] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,65535] +Int64 : [0,0,65535] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,65535] +Word64 : [0,0,65535] +testBits +65533 .&. 65533 = 65533 +65533 .&. 65534 = 65532 +65533 .&. 65535 = 65533 +65533 .&. 1 = 1 +65533 .&. 2 = 0 +65533 .&. 3 = 1 + +65534 .&. 65533 = 65532 +65534 .&. 65534 = 65534 +65534 .&. 65535 = 65534 +65534 .&. 1 = 0 +65534 .&. 2 = 2 +65534 .&. 3 = 2 + +65535 .&. 65533 = 65533 +65535 .&. 65534 = 65534 +65535 .&. 65535 = 65535 +65535 .&. 1 = 1 +65535 .&. 2 = 2 +65535 .&. 3 = 3 + +0 .&. 65533 = 0 +0 .&. 65534 = 0 +0 .&. 65535 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 65533 = 1 +1 .&. 65534 = 0 +1 .&. 65535 = 1 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 65533 = 0 +2 .&. 65534 = 2 +2 .&. 65535 = 2 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 65533 = 1 +3 .&. 65534 = 2 +3 .&. 65535 = 3 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +65533 .|. 65533 = 65533 +65533 .|. 65534 = 65535 +65533 .|. 65535 = 65535 +65533 .|. 1 = 65533 +65533 .|. 2 = 65535 +65533 .|. 3 = 65535 + +65534 .|. 65533 = 65535 +65534 .|. 65534 = 65534 +65534 .|. 65535 = 65535 +65534 .|. 1 = 65535 +65534 .|. 2 = 65534 +65534 .|. 3 = 65535 + +65535 .|. 65533 = 65535 +65535 .|. 65534 = 65535 +65535 .|. 65535 = 65535 +65535 .|. 1 = 65535 +65535 .|. 2 = 65535 +65535 .|. 3 = 65535 + +0 .|. 65533 = 65533 +0 .|. 65534 = 65534 +0 .|. 65535 = 65535 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 65533 = 65533 +1 .|. 65534 = 65535 +1 .|. 65535 = 65535 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 65533 = 65535 +2 .|. 65534 = 65534 +2 .|. 65535 = 65535 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 65533 = 65535 +3 .|. 65534 = 65535 +3 .|. 65535 = 65535 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +65533 `xor` 65533 = 0 +65533 `xor` 65534 = 3 +65533 `xor` 65535 = 2 +65533 `xor` 1 = 65532 +65533 `xor` 2 = 65535 +65533 `xor` 3 = 65534 + +65534 `xor` 65533 = 3 +65534 `xor` 65534 = 0 +65534 `xor` 65535 = 1 +65534 `xor` 1 = 65535 +65534 `xor` 2 = 65532 +65534 `xor` 3 = 65533 + +65535 `xor` 65533 = 2 +65535 `xor` 65534 = 1 +65535 `xor` 65535 = 0 +65535 `xor` 1 = 65534 +65535 `xor` 2 = 65533 +65535 `xor` 3 = 65532 + +0 `xor` 65533 = 65533 +0 `xor` 65534 = 65534 +0 `xor` 65535 = 65535 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 65533 = 65532 +1 `xor` 65534 = 65535 +1 `xor` 65535 = 65534 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 65533 = 65535 +2 `xor` 65534 = 65532 +2 `xor` 65535 = 65533 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 65533 = 65534 +3 `xor` 65534 = 65533 +3 `xor` 65535 = 65532 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 65533 = 2 +complement 65534 = 1 +complement 65535 = 0 +complement 0 = 65535 +complement 1 = 65534 +complement 2 = 65533 +complement 3 = 65532 +# +65533 `shiftL` 0 = 65533 +65533 `shiftL` 1 = 65530 +65533 `shiftL` 2 = 65524 +65533 `shiftL` 3 = 65512 +65533 `shiftL` 32 = 0 +65533 `shiftL` 64 = 0 + +65534 `shiftL` 0 = 65534 +65534 `shiftL` 1 = 65532 +65534 `shiftL` 2 = 65528 +65534 `shiftL` 3 = 65520 +65534 `shiftL` 32 = 0 +65534 `shiftL` 64 = 0 + +65535 `shiftL` 0 = 65535 +65535 `shiftL` 1 = 65534 +65535 `shiftL` 2 = 65532 +65535 `shiftL` 3 = 65528 +65535 `shiftL` 32 = 0 +65535 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +65533 `shiftR` 0 = 65533 +65533 `shiftR` 1 = 32766 +65533 `shiftR` 2 = 16383 +65533 `shiftR` 3 = 8191 +65533 `shiftR` 32 = 0 +65533 `shiftR` 64 = 0 + +65534 `shiftR` 0 = 65534 +65534 `shiftR` 1 = 32767 +65534 `shiftR` 2 = 16383 +65534 `shiftR` 3 = 8191 +65534 `shiftR` 32 = 0 +65534 `shiftR` 64 = 0 + +65535 `shiftR` 0 = 65535 +65535 `shiftR` 1 = 32767 +65535 `shiftR` 2 = 16383 +65535 `shiftR` 3 = 8191 +65535 `shiftR` 32 = 0 +65535 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +65533 `rotate` -3 = 49151 +65533 `rotate` -2 = 32767 +65533 `rotate` -1 = 65534 +65533 `rotate` 0 = 65533 +65533 `rotate` 1 = 65531 +65533 `rotate` 2 = 65527 +65533 `rotate` 3 = 65519 + +65534 `rotate` -3 = 57343 +65534 `rotate` -2 = 49151 +65534 `rotate` -1 = 32767 +65534 `rotate` 0 = 65534 +65534 `rotate` 1 = 65533 +65534 `rotate` 2 = 65531 +65534 `rotate` 3 = 65527 + +65535 `rotate` -3 = 65535 +65535 `rotate` -2 = 65535 +65535 `rotate` -1 = 65535 +65535 `rotate` 0 = 65535 +65535 `rotate` 1 = 65535 +65535 `rotate` 2 = 65535 +65535 `rotate` 3 = 65535 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 8192 +1 `rotate` -2 = 16384 +1 `rotate` -1 = 32768 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 16384 +2 `rotate` -2 = 32768 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 24576 +3 `rotate` -2 = 49152 +3 `rotate` -1 = 32769 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +65533 `setBit` 0 = 65533 +65533 `setBit` 1 = 65535 +65533 `setBit` 2 = 65533 +65533 `setBit` 3 = 65533 +65533 `setBit` 32 = 65533 +65533 `setBit` 64 = 65533 + +65534 `setBit` 0 = 65535 +65534 `setBit` 1 = 65534 +65534 `setBit` 2 = 65534 +65534 `setBit` 3 = 65534 +65534 `setBit` 32 = 65534 +65534 `setBit` 64 = 65534 + +65535 `setBit` 0 = 65535 +65535 `setBit` 1 = 65535 +65535 `setBit` 2 = 65535 +65535 `setBit` 3 = 65535 +65535 `setBit` 32 = 65535 +65535 `setBit` 64 = 65535 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +65533 `clearBit` 0 = 65532 +65533 `clearBit` 1 = 65533 +65533 `clearBit` 2 = 65529 +65533 `clearBit` 3 = 65525 +65533 `clearBit` 32 = 65533 +65533 `clearBit` 64 = 65533 + +65534 `clearBit` 0 = 65534 +65534 `clearBit` 1 = 65532 +65534 `clearBit` 2 = 65530 +65534 `clearBit` 3 = 65526 +65534 `clearBit` 32 = 65534 +65534 `clearBit` 64 = 65534 + +65535 `clearBit` 0 = 65534 +65535 `clearBit` 1 = 65533 +65535 `clearBit` 2 = 65531 +65535 `clearBit` 3 = 65527 +65535 `clearBit` 32 = 65535 +65535 `clearBit` 64 = 65535 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +65533 `complementBit` 0 = 65532 +65533 `complementBit` 1 = 65535 +65533 `complementBit` 2 = 65529 +65533 `complementBit` 3 = 65525 +65533 `complementBit` 32 = 65533 +65533 `complementBit` 64 = 65533 + +65534 `complementBit` 0 = 65535 +65534 `complementBit` 1 = 65532 +65534 `complementBit` 2 = 65530 +65534 `complementBit` 3 = 65526 +65534 `complementBit` 32 = 65534 +65534 `complementBit` 64 = 65534 + +65535 `complementBit` 0 = 65534 +65535 `complementBit` 1 = 65533 +65535 `complementBit` 2 = 65531 +65535 `complementBit` 3 = 65527 +65535 `complementBit` 32 = 65535 +65535 `complementBit` 64 = 65535 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +65533 `testBit` 0 = True +65533 `testBit` 1 = False +65533 `testBit` 2 = True +65533 `testBit` 3 = True +65533 `testBit` 32 = False +65533 `testBit` 64 = False + +65534 `testBit` 0 = False +65534 `testBit` 1 = True +65534 `testBit` 2 = True +65534 `testBit` 3 = True +65534 `testBit` 32 = False +65534 `testBit` 64 = False + +65535 `testBit` 0 = True +65535 `testBit` 1 = True +65535 `testBit` 2 = True +65535 `testBit` 3 = True +65535 `testBit` 32 = False +65535 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 65533 = 16 +bitSize 65534 = 16 +bitSize 65535 = 16 +bitSize 0 = 16 +bitSize 1 = 16 +bitSize 2 = 16 +bitSize 3 = 16 +# +isSigned 65533 = False +isSigned 65534 = False +isSigned 65535 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word32 +-------------------------------- +testBounded +(4294967295,0,1) +(4294967294,4294967295,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[4294967293,4294967294,4294967295,0,1,2,3] +[4294967293,4294967294,4294967295,0,1,2,3] +testEq +4294967293 == 4294967293 = True +4294967293 == 4294967294 = False +4294967293 == 4294967295 = False +4294967293 == 0 = False +4294967293 == 1 = False +4294967293 == 2 = False +4294967293 == 3 = False + +4294967294 == 4294967293 = False +4294967294 == 4294967294 = True +4294967294 == 4294967295 = False +4294967294 == 0 = False +4294967294 == 1 = False +4294967294 == 2 = False +4294967294 == 3 = False + +4294967295 == 4294967293 = False +4294967295 == 4294967294 = False +4294967295 == 4294967295 = True +4294967295 == 0 = False +4294967295 == 1 = False +4294967295 == 2 = False +4294967295 == 3 = False + +0 == 4294967293 = False +0 == 4294967294 = False +0 == 4294967295 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 4294967293 = False +1 == 4294967294 = False +1 == 4294967295 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 4294967293 = False +2 == 4294967294 = False +2 == 4294967295 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 4294967293 = False +3 == 4294967294 = False +3 == 4294967295 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +4294967293 /= 4294967293 = False +4294967293 /= 4294967294 = True +4294967293 /= 4294967295 = True +4294967293 /= 0 = True +4294967293 /= 1 = True +4294967293 /= 2 = True +4294967293 /= 3 = True + +4294967294 /= 4294967293 = True +4294967294 /= 4294967294 = False +4294967294 /= 4294967295 = True +4294967294 /= 0 = True +4294967294 /= 1 = True +4294967294 /= 2 = True +4294967294 /= 3 = True + +4294967295 /= 4294967293 = True +4294967295 /= 4294967294 = True +4294967295 /= 4294967295 = False +4294967295 /= 0 = True +4294967295 /= 1 = True +4294967295 /= 2 = True +4294967295 /= 3 = True + +0 /= 4294967293 = True +0 /= 4294967294 = True +0 /= 4294967295 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 4294967293 = True +1 /= 4294967294 = True +1 /= 4294967295 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 4294967293 = True +2 /= 4294967294 = True +2 /= 4294967295 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 4294967293 = True +3 /= 4294967294 = True +3 /= 4294967295 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +4294967293 <= 4294967293 = True +4294967293 <= 4294967294 = True +4294967293 <= 4294967295 = True +4294967293 <= 0 = False +4294967293 <= 1 = False +4294967293 <= 2 = False +4294967293 <= 3 = False + +4294967294 <= 4294967293 = False +4294967294 <= 4294967294 = True +4294967294 <= 4294967295 = True +4294967294 <= 0 = False +4294967294 <= 1 = False +4294967294 <= 2 = False +4294967294 <= 3 = False + +4294967295 <= 4294967293 = False +4294967295 <= 4294967294 = False +4294967295 <= 4294967295 = True +4294967295 <= 0 = False +4294967295 <= 1 = False +4294967295 <= 2 = False +4294967295 <= 3 = False + +0 <= 4294967293 = True +0 <= 4294967294 = True +0 <= 4294967295 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 4294967293 = True +1 <= 4294967294 = True +1 <= 4294967295 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 4294967293 = True +2 <= 4294967294 = True +2 <= 4294967295 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 4294967293 = True +3 <= 4294967294 = True +3 <= 4294967295 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +4294967293 < 4294967293 = False +4294967293 < 4294967294 = True +4294967293 < 4294967295 = True +4294967293 < 0 = False +4294967293 < 1 = False +4294967293 < 2 = False +4294967293 < 3 = False + +4294967294 < 4294967293 = False +4294967294 < 4294967294 = False +4294967294 < 4294967295 = True +4294967294 < 0 = False +4294967294 < 1 = False +4294967294 < 2 = False +4294967294 < 3 = False + +4294967295 < 4294967293 = False +4294967295 < 4294967294 = False +4294967295 < 4294967295 = False +4294967295 < 0 = False +4294967295 < 1 = False +4294967295 < 2 = False +4294967295 < 3 = False + +0 < 4294967293 = True +0 < 4294967294 = True +0 < 4294967295 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 4294967293 = True +1 < 4294967294 = True +1 < 4294967295 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 4294967293 = True +2 < 4294967294 = True +2 < 4294967295 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 4294967293 = True +3 < 4294967294 = True +3 < 4294967295 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +4294967293 > 4294967293 = False +4294967293 > 4294967294 = False +4294967293 > 4294967295 = False +4294967293 > 0 = True +4294967293 > 1 = True +4294967293 > 2 = True +4294967293 > 3 = True + +4294967294 > 4294967293 = True +4294967294 > 4294967294 = False +4294967294 > 4294967295 = False +4294967294 > 0 = True +4294967294 > 1 = True +4294967294 > 2 = True +4294967294 > 3 = True + +4294967295 > 4294967293 = True +4294967295 > 4294967294 = True +4294967295 > 4294967295 = False +4294967295 > 0 = True +4294967295 > 1 = True +4294967295 > 2 = True +4294967295 > 3 = True + +0 > 4294967293 = False +0 > 4294967294 = False +0 > 4294967295 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 4294967293 = False +1 > 4294967294 = False +1 > 4294967295 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 4294967293 = False +2 > 4294967294 = False +2 > 4294967295 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 4294967293 = False +3 > 4294967294 = False +3 > 4294967295 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +4294967293 >= 4294967293 = True +4294967293 >= 4294967294 = False +4294967293 >= 4294967295 = False +4294967293 >= 0 = True +4294967293 >= 1 = True +4294967293 >= 2 = True +4294967293 >= 3 = True + +4294967294 >= 4294967293 = True +4294967294 >= 4294967294 = True +4294967294 >= 4294967295 = False +4294967294 >= 0 = True +4294967294 >= 1 = True +4294967294 >= 2 = True +4294967294 >= 3 = True + +4294967295 >= 4294967293 = True +4294967295 >= 4294967294 = True +4294967295 >= 4294967295 = True +4294967295 >= 0 = True +4294967295 >= 1 = True +4294967295 >= 2 = True +4294967295 >= 3 = True + +0 >= 4294967293 = False +0 >= 4294967294 = False +0 >= 4294967295 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 4294967293 = False +1 >= 4294967294 = False +1 >= 4294967295 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 4294967293 = False +2 >= 4294967294 = False +2 >= 4294967295 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 4294967293 = False +3 >= 4294967294 = False +3 >= 4294967295 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +4294967293 `compare` 4294967293 = EQ +4294967293 `compare` 4294967294 = LT +4294967293 `compare` 4294967295 = LT +4294967293 `compare` 0 = GT +4294967293 `compare` 1 = GT +4294967293 `compare` 2 = GT +4294967293 `compare` 3 = GT + +4294967294 `compare` 4294967293 = GT +4294967294 `compare` 4294967294 = EQ +4294967294 `compare` 4294967295 = LT +4294967294 `compare` 0 = GT +4294967294 `compare` 1 = GT +4294967294 `compare` 2 = GT +4294967294 `compare` 3 = GT + +4294967295 `compare` 4294967293 = GT +4294967295 `compare` 4294967294 = GT +4294967295 `compare` 4294967295 = EQ +4294967295 `compare` 0 = GT +4294967295 `compare` 1 = GT +4294967295 `compare` 2 = GT +4294967295 `compare` 3 = GT + +0 `compare` 4294967293 = LT +0 `compare` 4294967294 = LT +0 `compare` 4294967295 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 4294967293 = LT +1 `compare` 4294967294 = LT +1 `compare` 4294967295 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 4294967293 = LT +2 `compare` 4294967294 = LT +2 `compare` 4294967295 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 4294967293 = LT +3 `compare` 4294967294 = LT +3 `compare` 4294967295 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +4294967293 + 4294967293 = 4294967290 +4294967293 + 4294967294 = 4294967291 +4294967293 + 4294967295 = 4294967292 +4294967293 + 0 = 4294967293 +4294967293 + 1 = 4294967294 +4294967293 + 2 = 4294967295 +4294967293 + 3 = 0 + +4294967294 + 4294967293 = 4294967291 +4294967294 + 4294967294 = 4294967292 +4294967294 + 4294967295 = 4294967293 +4294967294 + 0 = 4294967294 +4294967294 + 1 = 4294967295 +4294967294 + 2 = 0 +4294967294 + 3 = 1 + +4294967295 + 4294967293 = 4294967292 +4294967295 + 4294967294 = 4294967293 +4294967295 + 4294967295 = 4294967294 +4294967295 + 0 = 4294967295 +4294967295 + 1 = 0 +4294967295 + 2 = 1 +4294967295 + 3 = 2 + +0 + 4294967293 = 4294967293 +0 + 4294967294 = 4294967294 +0 + 4294967295 = 4294967295 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 4294967293 = 4294967294 +1 + 4294967294 = 4294967295 +1 + 4294967295 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 4294967293 = 4294967295 +2 + 4294967294 = 0 +2 + 4294967295 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 4294967293 = 0 +3 + 4294967294 = 1 +3 + 4294967295 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +4294967293 - 4294967293 = 0 +4294967293 - 4294967294 = 4294967295 +4294967293 - 4294967295 = 4294967294 +4294967293 - 0 = 4294967293 +4294967293 - 1 = 4294967292 +4294967293 - 2 = 4294967291 +4294967293 - 3 = 4294967290 + +4294967294 - 4294967293 = 1 +4294967294 - 4294967294 = 0 +4294967294 - 4294967295 = 4294967295 +4294967294 - 0 = 4294967294 +4294967294 - 1 = 4294967293 +4294967294 - 2 = 4294967292 +4294967294 - 3 = 4294967291 + +4294967295 - 4294967293 = 2 +4294967295 - 4294967294 = 1 +4294967295 - 4294967295 = 0 +4294967295 - 0 = 4294967295 +4294967295 - 1 = 4294967294 +4294967295 - 2 = 4294967293 +4294967295 - 3 = 4294967292 + +0 - 4294967293 = 3 +0 - 4294967294 = 2 +0 - 4294967295 = 1 +0 - 0 = 0 +0 - 1 = 4294967295 +0 - 2 = 4294967294 +0 - 3 = 4294967293 + +1 - 4294967293 = 4 +1 - 4294967294 = 3 +1 - 4294967295 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 4294967295 +1 - 3 = 4294967294 + +2 - 4294967293 = 5 +2 - 4294967294 = 4 +2 - 4294967295 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 4294967295 + +3 - 4294967293 = 6 +3 - 4294967294 = 5 +3 - 4294967295 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +4294967293 * 4294967293 = 9 +4294967293 * 4294967294 = 6 +4294967293 * 4294967295 = 3 +4294967293 * 0 = 0 +4294967293 * 1 = 4294967293 +4294967293 * 2 = 4294967290 +4294967293 * 3 = 4294967287 + +4294967294 * 4294967293 = 6 +4294967294 * 4294967294 = 4 +4294967294 * 4294967295 = 2 +4294967294 * 0 = 0 +4294967294 * 1 = 4294967294 +4294967294 * 2 = 4294967292 +4294967294 * 3 = 4294967290 + +4294967295 * 4294967293 = 3 +4294967295 * 4294967294 = 2 +4294967295 * 4294967295 = 1 +4294967295 * 0 = 0 +4294967295 * 1 = 4294967295 +4294967295 * 2 = 4294967294 +4294967295 * 3 = 4294967293 + +0 * 4294967293 = 0 +0 * 4294967294 = 0 +0 * 4294967295 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 4294967293 = 4294967293 +1 * 4294967294 = 4294967294 +1 * 4294967295 = 4294967295 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 4294967293 = 4294967290 +2 * 4294967294 = 4294967292 +2 * 4294967295 = 4294967294 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 4294967293 = 4294967287 +3 * 4294967294 = 4294967290 +3 * 4294967295 = 4294967293 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 4294967293 = 3 +negate 4294967294 = 2 +negate 4294967295 = 1 +negate 0 = 0 +negate 1 = 4294967295 +negate 2 = 4294967294 +negate 3 = 4294967293 +# +testReal +toRational 4294967293 = 4294967293 % 1 +toRational 4294967294 = 4294967294 % 1 +toRational 4294967295 = 4294967295 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +4294967293 `divMod` 4294967293 = (1,0) +4294967293 `divMod` 4294967294 = (0,4294967293) +4294967293 `divMod` 4294967295 = (0,4294967293) +4294967293 `divMod` 1 = (4294967293,0) +4294967293 `divMod` 2 = (2147483646,1) +4294967293 `divMod` 3 = (1431655764,1) + +4294967294 `divMod` 4294967293 = (1,1) +4294967294 `divMod` 4294967294 = (1,0) +4294967294 `divMod` 4294967295 = (0,4294967294) +4294967294 `divMod` 1 = (4294967294,0) +4294967294 `divMod` 2 = (2147483647,0) +4294967294 `divMod` 3 = (1431655764,2) + +4294967295 `divMod` 4294967293 = (1,2) +4294967295 `divMod` 4294967294 = (1,1) +4294967295 `divMod` 4294967295 = (1,0) +4294967295 `divMod` 1 = (4294967295,0) +4294967295 `divMod` 2 = (2147483647,1) +4294967295 `divMod` 3 = (1431655765,0) + +0 `divMod` 4294967293 = (0,0) +0 `divMod` 4294967294 = (0,0) +0 `divMod` 4294967295 = (0,0) +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 4294967293 = (0,1) +1 `divMod` 4294967294 = (0,1) +1 `divMod` 4294967295 = (0,1) +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 4294967293 = (0,2) +2 `divMod` 4294967294 = (0,2) +2 `divMod` 4294967295 = (0,2) +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 4294967293 = (0,3) +3 `divMod` 4294967294 = (0,3) +3 `divMod` 4294967295 = (0,3) +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +4294967293 `div` 4294967293 = 1 +4294967293 `div` 4294967294 = 0 +4294967293 `div` 4294967295 = 0 +4294967293 `div` 1 = 4294967293 +4294967293 `div` 2 = 2147483646 +4294967293 `div` 3 = 1431655764 + +4294967294 `div` 4294967293 = 1 +4294967294 `div` 4294967294 = 1 +4294967294 `div` 4294967295 = 0 +4294967294 `div` 1 = 4294967294 +4294967294 `div` 2 = 2147483647 +4294967294 `div` 3 = 1431655764 + +4294967295 `div` 4294967293 = 1 +4294967295 `div` 4294967294 = 1 +4294967295 `div` 4294967295 = 1 +4294967295 `div` 1 = 4294967295 +4294967295 `div` 2 = 2147483647 +4294967295 `div` 3 = 1431655765 + +0 `div` 4294967293 = 0 +0 `div` 4294967294 = 0 +0 `div` 4294967295 = 0 +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 4294967293 = 0 +1 `div` 4294967294 = 0 +1 `div` 4294967295 = 0 +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 4294967293 = 0 +2 `div` 4294967294 = 0 +2 `div` 4294967295 = 0 +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 4294967293 = 0 +3 `div` 4294967294 = 0 +3 `div` 4294967295 = 0 +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +4294967293 `mod` 4294967293 = 0 +4294967293 `mod` 4294967294 = 4294967293 +4294967293 `mod` 4294967295 = 4294967293 +4294967293 `mod` 1 = 0 +4294967293 `mod` 2 = 1 +4294967293 `mod` 3 = 1 + +4294967294 `mod` 4294967293 = 1 +4294967294 `mod` 4294967294 = 0 +4294967294 `mod` 4294967295 = 4294967294 +4294967294 `mod` 1 = 0 +4294967294 `mod` 2 = 0 +4294967294 `mod` 3 = 2 + +4294967295 `mod` 4294967293 = 2 +4294967295 `mod` 4294967294 = 1 +4294967295 `mod` 4294967295 = 0 +4294967295 `mod` 1 = 0 +4294967295 `mod` 2 = 1 +4294967295 `mod` 3 = 0 + +0 `mod` 4294967293 = 0 +0 `mod` 4294967294 = 0 +0 `mod` 4294967295 = 0 +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 4294967293 = 1 +1 `mod` 4294967294 = 1 +1 `mod` 4294967295 = 1 +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 4294967293 = 2 +2 `mod` 4294967294 = 2 +2 `mod` 4294967295 = 2 +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 4294967293 = 3 +3 `mod` 4294967294 = 3 +3 `mod` 4294967295 = 3 +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +4294967293 `quotRem` 4294967293 = (1,0) +4294967293 `quotRem` 4294967294 = (0,4294967293) +4294967293 `quotRem` 4294967295 = (0,4294967293) +4294967293 `quotRem` 1 = (4294967293,0) +4294967293 `quotRem` 2 = (2147483646,1) +4294967293 `quotRem` 3 = (1431655764,1) + +4294967294 `quotRem` 4294967293 = (1,1) +4294967294 `quotRem` 4294967294 = (1,0) +4294967294 `quotRem` 4294967295 = (0,4294967294) +4294967294 `quotRem` 1 = (4294967294,0) +4294967294 `quotRem` 2 = (2147483647,0) +4294967294 `quotRem` 3 = (1431655764,2) + +4294967295 `quotRem` 4294967293 = (1,2) +4294967295 `quotRem` 4294967294 = (1,1) +4294967295 `quotRem` 4294967295 = (1,0) +4294967295 `quotRem` 1 = (4294967295,0) +4294967295 `quotRem` 2 = (2147483647,1) +4294967295 `quotRem` 3 = (1431655765,0) + +0 `quotRem` 4294967293 = (0,0) +0 `quotRem` 4294967294 = (0,0) +0 `quotRem` 4294967295 = (0,0) +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 4294967293 = (0,1) +1 `quotRem` 4294967294 = (0,1) +1 `quotRem` 4294967295 = (0,1) +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 4294967293 = (0,2) +2 `quotRem` 4294967294 = (0,2) +2 `quotRem` 4294967295 = (0,2) +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 4294967293 = (0,3) +3 `quotRem` 4294967294 = (0,3) +3 `quotRem` 4294967295 = (0,3) +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +4294967293 `quot` 4294967293 = 1 +4294967293 `quot` 4294967294 = 0 +4294967293 `quot` 4294967295 = 0 +4294967293 `quot` 1 = 4294967293 +4294967293 `quot` 2 = 2147483646 +4294967293 `quot` 3 = 1431655764 + +4294967294 `quot` 4294967293 = 1 +4294967294 `quot` 4294967294 = 1 +4294967294 `quot` 4294967295 = 0 +4294967294 `quot` 1 = 4294967294 +4294967294 `quot` 2 = 2147483647 +4294967294 `quot` 3 = 1431655764 + +4294967295 `quot` 4294967293 = 1 +4294967295 `quot` 4294967294 = 1 +4294967295 `quot` 4294967295 = 1 +4294967295 `quot` 1 = 4294967295 +4294967295 `quot` 2 = 2147483647 +4294967295 `quot` 3 = 1431655765 + +0 `quot` 4294967293 = 0 +0 `quot` 4294967294 = 0 +0 `quot` 4294967295 = 0 +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 4294967293 = 0 +1 `quot` 4294967294 = 0 +1 `quot` 4294967295 = 0 +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 4294967293 = 0 +2 `quot` 4294967294 = 0 +2 `quot` 4294967295 = 0 +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 4294967293 = 0 +3 `quot` 4294967294 = 0 +3 `quot` 4294967295 = 0 +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +4294967293 `rem` 4294967293 = 0 +4294967293 `rem` 4294967294 = 4294967293 +4294967293 `rem` 4294967295 = 4294967293 +4294967293 `rem` 1 = 0 +4294967293 `rem` 2 = 1 +4294967293 `rem` 3 = 1 + +4294967294 `rem` 4294967293 = 1 +4294967294 `rem` 4294967294 = 0 +4294967294 `rem` 4294967295 = 4294967294 +4294967294 `rem` 1 = 0 +4294967294 `rem` 2 = 0 +4294967294 `rem` 3 = 2 + +4294967295 `rem` 4294967293 = 2 +4294967295 `rem` 4294967294 = 1 +4294967295 `rem` 4294967295 = 0 +4294967295 `rem` 1 = 0 +4294967295 `rem` 2 = 1 +4294967295 `rem` 3 = 0 + +0 `rem` 4294967293 = 0 +0 `rem` 4294967294 = 0 +0 `rem` 4294967295 = 0 +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 4294967293 = 1 +1 `rem` 4294967294 = 1 +1 `rem` 4294967295 = 1 +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 4294967293 = 2 +2 `rem` 4294967294 = 2 +2 `rem` 4294967295 = 2 +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 4294967293 = 3 +3 `rem` 4294967294 = 3 +3 `rem` 4294967295 = 3 +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,4294967295] +Int : [0,0,4294967295] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [0,0,4294967295] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [0,0,4294967295] +testBits +4294967293 .&. 4294967293 = 4294967293 +4294967293 .&. 4294967294 = 4294967292 +4294967293 .&. 4294967295 = 4294967293 +4294967293 .&. 1 = 1 +4294967293 .&. 2 = 0 +4294967293 .&. 3 = 1 + +4294967294 .&. 4294967293 = 4294967292 +4294967294 .&. 4294967294 = 4294967294 +4294967294 .&. 4294967295 = 4294967294 +4294967294 .&. 1 = 0 +4294967294 .&. 2 = 2 +4294967294 .&. 3 = 2 + +4294967295 .&. 4294967293 = 4294967293 +4294967295 .&. 4294967294 = 4294967294 +4294967295 .&. 4294967295 = 4294967295 +4294967295 .&. 1 = 1 +4294967295 .&. 2 = 2 +4294967295 .&. 3 = 3 + +0 .&. 4294967293 = 0 +0 .&. 4294967294 = 0 +0 .&. 4294967295 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 4294967293 = 1 +1 .&. 4294967294 = 0 +1 .&. 4294967295 = 1 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 4294967293 = 0 +2 .&. 4294967294 = 2 +2 .&. 4294967295 = 2 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 4294967293 = 1 +3 .&. 4294967294 = 2 +3 .&. 4294967295 = 3 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +4294967293 .|. 4294967293 = 4294967293 +4294967293 .|. 4294967294 = 4294967295 +4294967293 .|. 4294967295 = 4294967295 +4294967293 .|. 1 = 4294967293 +4294967293 .|. 2 = 4294967295 +4294967293 .|. 3 = 4294967295 + +4294967294 .|. 4294967293 = 4294967295 +4294967294 .|. 4294967294 = 4294967294 +4294967294 .|. 4294967295 = 4294967295 +4294967294 .|. 1 = 4294967295 +4294967294 .|. 2 = 4294967294 +4294967294 .|. 3 = 4294967295 + +4294967295 .|. 4294967293 = 4294967295 +4294967295 .|. 4294967294 = 4294967295 +4294967295 .|. 4294967295 = 4294967295 +4294967295 .|. 1 = 4294967295 +4294967295 .|. 2 = 4294967295 +4294967295 .|. 3 = 4294967295 + +0 .|. 4294967293 = 4294967293 +0 .|. 4294967294 = 4294967294 +0 .|. 4294967295 = 4294967295 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 4294967293 = 4294967293 +1 .|. 4294967294 = 4294967295 +1 .|. 4294967295 = 4294967295 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 4294967293 = 4294967295 +2 .|. 4294967294 = 4294967294 +2 .|. 4294967295 = 4294967295 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 4294967293 = 4294967295 +3 .|. 4294967294 = 4294967295 +3 .|. 4294967295 = 4294967295 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +4294967293 `xor` 4294967293 = 0 +4294967293 `xor` 4294967294 = 3 +4294967293 `xor` 4294967295 = 2 +4294967293 `xor` 1 = 4294967292 +4294967293 `xor` 2 = 4294967295 +4294967293 `xor` 3 = 4294967294 + +4294967294 `xor` 4294967293 = 3 +4294967294 `xor` 4294967294 = 0 +4294967294 `xor` 4294967295 = 1 +4294967294 `xor` 1 = 4294967295 +4294967294 `xor` 2 = 4294967292 +4294967294 `xor` 3 = 4294967293 + +4294967295 `xor` 4294967293 = 2 +4294967295 `xor` 4294967294 = 1 +4294967295 `xor` 4294967295 = 0 +4294967295 `xor` 1 = 4294967294 +4294967295 `xor` 2 = 4294967293 +4294967295 `xor` 3 = 4294967292 + +0 `xor` 4294967293 = 4294967293 +0 `xor` 4294967294 = 4294967294 +0 `xor` 4294967295 = 4294967295 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 4294967293 = 4294967292 +1 `xor` 4294967294 = 4294967295 +1 `xor` 4294967295 = 4294967294 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 4294967293 = 4294967295 +2 `xor` 4294967294 = 4294967292 +2 `xor` 4294967295 = 4294967293 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 4294967293 = 4294967294 +3 `xor` 4294967294 = 4294967293 +3 `xor` 4294967295 = 4294967292 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 4294967293 = 2 +complement 4294967294 = 1 +complement 4294967295 = 0 +complement 0 = 4294967295 +complement 1 = 4294967294 +complement 2 = 4294967293 +complement 3 = 4294967292 +# +4294967293 `shiftL` 0 = 4294967293 +4294967293 `shiftL` 1 = 4294967290 +4294967293 `shiftL` 2 = 4294967284 +4294967293 `shiftL` 3 = 4294967272 +4294967293 `shiftL` 32 = 0 +4294967293 `shiftL` 64 = 0 + +4294967294 `shiftL` 0 = 4294967294 +4294967294 `shiftL` 1 = 4294967292 +4294967294 `shiftL` 2 = 4294967288 +4294967294 `shiftL` 3 = 4294967280 +4294967294 `shiftL` 32 = 0 +4294967294 `shiftL` 64 = 0 + +4294967295 `shiftL` 0 = 4294967295 +4294967295 `shiftL` 1 = 4294967294 +4294967295 `shiftL` 2 = 4294967292 +4294967295 `shiftL` 3 = 4294967288 +4294967295 `shiftL` 32 = 0 +4294967295 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +4294967293 `shiftR` 0 = 4294967293 +4294967293 `shiftR` 1 = 2147483646 +4294967293 `shiftR` 2 = 1073741823 +4294967293 `shiftR` 3 = 536870911 +4294967293 `shiftR` 32 = 0 +4294967293 `shiftR` 64 = 0 + +4294967294 `shiftR` 0 = 4294967294 +4294967294 `shiftR` 1 = 2147483647 +4294967294 `shiftR` 2 = 1073741823 +4294967294 `shiftR` 3 = 536870911 +4294967294 `shiftR` 32 = 0 +4294967294 `shiftR` 64 = 0 + +4294967295 `shiftR` 0 = 4294967295 +4294967295 `shiftR` 1 = 2147483647 +4294967295 `shiftR` 2 = 1073741823 +4294967295 `shiftR` 3 = 536870911 +4294967295 `shiftR` 32 = 0 +4294967295 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +4294967293 `rotate` -3 = 3221225471 +4294967293 `rotate` -2 = 2147483647 +4294967293 `rotate` -1 = 4294967294 +4294967293 `rotate` 0 = 4294967293 +4294967293 `rotate` 1 = 4294967291 +4294967293 `rotate` 2 = 4294967287 +4294967293 `rotate` 3 = 4294967279 + +4294967294 `rotate` -3 = 3758096383 +4294967294 `rotate` -2 = 3221225471 +4294967294 `rotate` -1 = 2147483647 +4294967294 `rotate` 0 = 4294967294 +4294967294 `rotate` 1 = 4294967293 +4294967294 `rotate` 2 = 4294967291 +4294967294 `rotate` 3 = 4294967287 + +4294967295 `rotate` -3 = 4294967295 +4294967295 `rotate` -2 = 4294967295 +4294967295 `rotate` -1 = 4294967295 +4294967295 `rotate` 0 = 4294967295 +4294967295 `rotate` 1 = 4294967295 +4294967295 `rotate` 2 = 4294967295 +4294967295 `rotate` 3 = 4294967295 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 536870912 +1 `rotate` -2 = 1073741824 +1 `rotate` -1 = 2147483648 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 1073741824 +2 `rotate` -2 = 2147483648 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 1610612736 +3 `rotate` -2 = 3221225472 +3 `rotate` -1 = 2147483649 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +4294967293 `setBit` 0 = 4294967293 +4294967293 `setBit` 1 = 4294967295 +4294967293 `setBit` 2 = 4294967293 +4294967293 `setBit` 3 = 4294967293 +4294967293 `setBit` 32 = 4294967293 +4294967293 `setBit` 64 = 4294967293 + +4294967294 `setBit` 0 = 4294967295 +4294967294 `setBit` 1 = 4294967294 +4294967294 `setBit` 2 = 4294967294 +4294967294 `setBit` 3 = 4294967294 +4294967294 `setBit` 32 = 4294967294 +4294967294 `setBit` 64 = 4294967294 + +4294967295 `setBit` 0 = 4294967295 +4294967295 `setBit` 1 = 4294967295 +4294967295 `setBit` 2 = 4294967295 +4294967295 `setBit` 3 = 4294967295 +4294967295 `setBit` 32 = 4294967295 +4294967295 `setBit` 64 = 4294967295 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +4294967293 `clearBit` 0 = 4294967292 +4294967293 `clearBit` 1 = 4294967293 +4294967293 `clearBit` 2 = 4294967289 +4294967293 `clearBit` 3 = 4294967285 +4294967293 `clearBit` 32 = 4294967293 +4294967293 `clearBit` 64 = 4294967293 + +4294967294 `clearBit` 0 = 4294967294 +4294967294 `clearBit` 1 = 4294967292 +4294967294 `clearBit` 2 = 4294967290 +4294967294 `clearBit` 3 = 4294967286 +4294967294 `clearBit` 32 = 4294967294 +4294967294 `clearBit` 64 = 4294967294 + +4294967295 `clearBit` 0 = 4294967294 +4294967295 `clearBit` 1 = 4294967293 +4294967295 `clearBit` 2 = 4294967291 +4294967295 `clearBit` 3 = 4294967287 +4294967295 `clearBit` 32 = 4294967295 +4294967295 `clearBit` 64 = 4294967295 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +4294967293 `complementBit` 0 = 4294967292 +4294967293 `complementBit` 1 = 4294967295 +4294967293 `complementBit` 2 = 4294967289 +4294967293 `complementBit` 3 = 4294967285 +4294967293 `complementBit` 32 = 4294967293 +4294967293 `complementBit` 64 = 4294967293 + +4294967294 `complementBit` 0 = 4294967295 +4294967294 `complementBit` 1 = 4294967292 +4294967294 `complementBit` 2 = 4294967290 +4294967294 `complementBit` 3 = 4294967286 +4294967294 `complementBit` 32 = 4294967294 +4294967294 `complementBit` 64 = 4294967294 + +4294967295 `complementBit` 0 = 4294967294 +4294967295 `complementBit` 1 = 4294967293 +4294967295 `complementBit` 2 = 4294967291 +4294967295 `complementBit` 3 = 4294967287 +4294967295 `complementBit` 32 = 4294967295 +4294967295 `complementBit` 64 = 4294967295 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +4294967293 `testBit` 0 = True +4294967293 `testBit` 1 = False +4294967293 `testBit` 2 = True +4294967293 `testBit` 3 = True +4294967293 `testBit` 32 = False +4294967293 `testBit` 64 = False + +4294967294 `testBit` 0 = False +4294967294 `testBit` 1 = True +4294967294 `testBit` 2 = True +4294967294 `testBit` 3 = True +4294967294 `testBit` 32 = False +4294967294 `testBit` 64 = False + +4294967295 `testBit` 0 = True +4294967295 `testBit` 1 = True +4294967295 `testBit` 2 = True +4294967295 `testBit` 3 = True +4294967295 `testBit` 32 = False +4294967295 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 4294967293 = 32 +bitSize 4294967294 = 32 +bitSize 4294967295 = 32 +bitSize 0 = 32 +bitSize 1 = 32 +bitSize 2 = 32 +bitSize 3 = 32 +# +isSigned 4294967293 = False +isSigned 4294967294 = False +isSigned 4294967295 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word64 +-------------------------------- +testBounded +(18446744073709551615,0,1) +(18446744073709551614,18446744073709551615,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[18446744073709551613,18446744073709551614,18446744073709551615,0,1,2,3] +[18446744073709551613,18446744073709551614,18446744073709551615,0,1,2,3] +testEq +18446744073709551613 == 18446744073709551613 = True +18446744073709551613 == 18446744073709551614 = False +18446744073709551613 == 18446744073709551615 = False +18446744073709551613 == 0 = False +18446744073709551613 == 1 = False +18446744073709551613 == 2 = False +18446744073709551613 == 3 = False + +18446744073709551614 == 18446744073709551613 = False +18446744073709551614 == 18446744073709551614 = True +18446744073709551614 == 18446744073709551615 = False +18446744073709551614 == 0 = False +18446744073709551614 == 1 = False +18446744073709551614 == 2 = False +18446744073709551614 == 3 = False + +18446744073709551615 == 18446744073709551613 = False +18446744073709551615 == 18446744073709551614 = False +18446744073709551615 == 18446744073709551615 = True +18446744073709551615 == 0 = False +18446744073709551615 == 1 = False +18446744073709551615 == 2 = False +18446744073709551615 == 3 = False + +0 == 18446744073709551613 = False +0 == 18446744073709551614 = False +0 == 18446744073709551615 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 18446744073709551613 = False +1 == 18446744073709551614 = False +1 == 18446744073709551615 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 18446744073709551613 = False +2 == 18446744073709551614 = False +2 == 18446744073709551615 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 18446744073709551613 = False +3 == 18446744073709551614 = False +3 == 18446744073709551615 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +18446744073709551613 /= 18446744073709551613 = False +18446744073709551613 /= 18446744073709551614 = True +18446744073709551613 /= 18446744073709551615 = True +18446744073709551613 /= 0 = True +18446744073709551613 /= 1 = True +18446744073709551613 /= 2 = True +18446744073709551613 /= 3 = True + +18446744073709551614 /= 18446744073709551613 = True +18446744073709551614 /= 18446744073709551614 = False +18446744073709551614 /= 18446744073709551615 = True +18446744073709551614 /= 0 = True +18446744073709551614 /= 1 = True +18446744073709551614 /= 2 = True +18446744073709551614 /= 3 = True + +18446744073709551615 /= 18446744073709551613 = True +18446744073709551615 /= 18446744073709551614 = True +18446744073709551615 /= 18446744073709551615 = False +18446744073709551615 /= 0 = True +18446744073709551615 /= 1 = True +18446744073709551615 /= 2 = True +18446744073709551615 /= 3 = True + +0 /= 18446744073709551613 = True +0 /= 18446744073709551614 = True +0 /= 18446744073709551615 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 18446744073709551613 = True +1 /= 18446744073709551614 = True +1 /= 18446744073709551615 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 18446744073709551613 = True +2 /= 18446744073709551614 = True +2 /= 18446744073709551615 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 18446744073709551613 = True +3 /= 18446744073709551614 = True +3 /= 18446744073709551615 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +18446744073709551613 <= 18446744073709551613 = True +18446744073709551613 <= 18446744073709551614 = True +18446744073709551613 <= 18446744073709551615 = True +18446744073709551613 <= 0 = False +18446744073709551613 <= 1 = False +18446744073709551613 <= 2 = False +18446744073709551613 <= 3 = False + +18446744073709551614 <= 18446744073709551613 = False +18446744073709551614 <= 18446744073709551614 = True +18446744073709551614 <= 18446744073709551615 = True +18446744073709551614 <= 0 = False +18446744073709551614 <= 1 = False +18446744073709551614 <= 2 = False +18446744073709551614 <= 3 = False + +18446744073709551615 <= 18446744073709551613 = False +18446744073709551615 <= 18446744073709551614 = False +18446744073709551615 <= 18446744073709551615 = True +18446744073709551615 <= 0 = False +18446744073709551615 <= 1 = False +18446744073709551615 <= 2 = False +18446744073709551615 <= 3 = False + +0 <= 18446744073709551613 = True +0 <= 18446744073709551614 = True +0 <= 18446744073709551615 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 18446744073709551613 = True +1 <= 18446744073709551614 = True +1 <= 18446744073709551615 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 18446744073709551613 = True +2 <= 18446744073709551614 = True +2 <= 18446744073709551615 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 18446744073709551613 = True +3 <= 18446744073709551614 = True +3 <= 18446744073709551615 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +18446744073709551613 < 18446744073709551613 = False +18446744073709551613 < 18446744073709551614 = True +18446744073709551613 < 18446744073709551615 = True +18446744073709551613 < 0 = False +18446744073709551613 < 1 = False +18446744073709551613 < 2 = False +18446744073709551613 < 3 = False + +18446744073709551614 < 18446744073709551613 = False +18446744073709551614 < 18446744073709551614 = False +18446744073709551614 < 18446744073709551615 = True +18446744073709551614 < 0 = False +18446744073709551614 < 1 = False +18446744073709551614 < 2 = False +18446744073709551614 < 3 = False + +18446744073709551615 < 18446744073709551613 = False +18446744073709551615 < 18446744073709551614 = False +18446744073709551615 < 18446744073709551615 = False +18446744073709551615 < 0 = False +18446744073709551615 < 1 = False +18446744073709551615 < 2 = False +18446744073709551615 < 3 = False + +0 < 18446744073709551613 = True +0 < 18446744073709551614 = True +0 < 18446744073709551615 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 18446744073709551613 = True +1 < 18446744073709551614 = True +1 < 18446744073709551615 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 18446744073709551613 = True +2 < 18446744073709551614 = True +2 < 18446744073709551615 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 18446744073709551613 = True +3 < 18446744073709551614 = True +3 < 18446744073709551615 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +18446744073709551613 > 18446744073709551613 = False +18446744073709551613 > 18446744073709551614 = False +18446744073709551613 > 18446744073709551615 = False +18446744073709551613 > 0 = True +18446744073709551613 > 1 = True +18446744073709551613 > 2 = True +18446744073709551613 > 3 = True + +18446744073709551614 > 18446744073709551613 = True +18446744073709551614 > 18446744073709551614 = False +18446744073709551614 > 18446744073709551615 = False +18446744073709551614 > 0 = True +18446744073709551614 > 1 = True +18446744073709551614 > 2 = True +18446744073709551614 > 3 = True + +18446744073709551615 > 18446744073709551613 = True +18446744073709551615 > 18446744073709551614 = True +18446744073709551615 > 18446744073709551615 = False +18446744073709551615 > 0 = True +18446744073709551615 > 1 = True +18446744073709551615 > 2 = True +18446744073709551615 > 3 = True + +0 > 18446744073709551613 = False +0 > 18446744073709551614 = False +0 > 18446744073709551615 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 18446744073709551613 = False +1 > 18446744073709551614 = False +1 > 18446744073709551615 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 18446744073709551613 = False +2 > 18446744073709551614 = False +2 > 18446744073709551615 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 18446744073709551613 = False +3 > 18446744073709551614 = False +3 > 18446744073709551615 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +18446744073709551613 >= 18446744073709551613 = True +18446744073709551613 >= 18446744073709551614 = False +18446744073709551613 >= 18446744073709551615 = False +18446744073709551613 >= 0 = True +18446744073709551613 >= 1 = True +18446744073709551613 >= 2 = True +18446744073709551613 >= 3 = True + +18446744073709551614 >= 18446744073709551613 = True +18446744073709551614 >= 18446744073709551614 = True +18446744073709551614 >= 18446744073709551615 = False +18446744073709551614 >= 0 = True +18446744073709551614 >= 1 = True +18446744073709551614 >= 2 = True +18446744073709551614 >= 3 = True + +18446744073709551615 >= 18446744073709551613 = True +18446744073709551615 >= 18446744073709551614 = True +18446744073709551615 >= 18446744073709551615 = True +18446744073709551615 >= 0 = True +18446744073709551615 >= 1 = True +18446744073709551615 >= 2 = True +18446744073709551615 >= 3 = True + +0 >= 18446744073709551613 = False +0 >= 18446744073709551614 = False +0 >= 18446744073709551615 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 18446744073709551613 = False +1 >= 18446744073709551614 = False +1 >= 18446744073709551615 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 18446744073709551613 = False +2 >= 18446744073709551614 = False +2 >= 18446744073709551615 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 18446744073709551613 = False +3 >= 18446744073709551614 = False +3 >= 18446744073709551615 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +18446744073709551613 `compare` 18446744073709551613 = EQ +18446744073709551613 `compare` 18446744073709551614 = LT +18446744073709551613 `compare` 18446744073709551615 = LT +18446744073709551613 `compare` 0 = GT +18446744073709551613 `compare` 1 = GT +18446744073709551613 `compare` 2 = GT +18446744073709551613 `compare` 3 = GT + +18446744073709551614 `compare` 18446744073709551613 = GT +18446744073709551614 `compare` 18446744073709551614 = EQ +18446744073709551614 `compare` 18446744073709551615 = LT +18446744073709551614 `compare` 0 = GT +18446744073709551614 `compare` 1 = GT +18446744073709551614 `compare` 2 = GT +18446744073709551614 `compare` 3 = GT + +18446744073709551615 `compare` 18446744073709551613 = GT +18446744073709551615 `compare` 18446744073709551614 = GT +18446744073709551615 `compare` 18446744073709551615 = EQ +18446744073709551615 `compare` 0 = GT +18446744073709551615 `compare` 1 = GT +18446744073709551615 `compare` 2 = GT +18446744073709551615 `compare` 3 = GT + +0 `compare` 18446744073709551613 = LT +0 `compare` 18446744073709551614 = LT +0 `compare` 18446744073709551615 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 18446744073709551613 = LT +1 `compare` 18446744073709551614 = LT +1 `compare` 18446744073709551615 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 18446744073709551613 = LT +2 `compare` 18446744073709551614 = LT +2 `compare` 18446744073709551615 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 18446744073709551613 = LT +3 `compare` 18446744073709551614 = LT +3 `compare` 18446744073709551615 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +18446744073709551613 + 18446744073709551613 = 18446744073709551610 +18446744073709551613 + 18446744073709551614 = 18446744073709551611 +18446744073709551613 + 18446744073709551615 = 18446744073709551612 +18446744073709551613 + 0 = 18446744073709551613 +18446744073709551613 + 1 = 18446744073709551614 +18446744073709551613 + 2 = 18446744073709551615 +18446744073709551613 + 3 = 0 + +18446744073709551614 + 18446744073709551613 = 18446744073709551611 +18446744073709551614 + 18446744073709551614 = 18446744073709551612 +18446744073709551614 + 18446744073709551615 = 18446744073709551613 +18446744073709551614 + 0 = 18446744073709551614 +18446744073709551614 + 1 = 18446744073709551615 +18446744073709551614 + 2 = 0 +18446744073709551614 + 3 = 1 + +18446744073709551615 + 18446744073709551613 = 18446744073709551612 +18446744073709551615 + 18446744073709551614 = 18446744073709551613 +18446744073709551615 + 18446744073709551615 = 18446744073709551614 +18446744073709551615 + 0 = 18446744073709551615 +18446744073709551615 + 1 = 0 +18446744073709551615 + 2 = 1 +18446744073709551615 + 3 = 2 + +0 + 18446744073709551613 = 18446744073709551613 +0 + 18446744073709551614 = 18446744073709551614 +0 + 18446744073709551615 = 18446744073709551615 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 18446744073709551613 = 18446744073709551614 +1 + 18446744073709551614 = 18446744073709551615 +1 + 18446744073709551615 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 18446744073709551613 = 18446744073709551615 +2 + 18446744073709551614 = 0 +2 + 18446744073709551615 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 18446744073709551613 = 0 +3 + 18446744073709551614 = 1 +3 + 18446744073709551615 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +18446744073709551613 - 18446744073709551613 = 0 +18446744073709551613 - 18446744073709551614 = 18446744073709551615 +18446744073709551613 - 18446744073709551615 = 18446744073709551614 +18446744073709551613 - 0 = 18446744073709551613 +18446744073709551613 - 1 = 18446744073709551612 +18446744073709551613 - 2 = 18446744073709551611 +18446744073709551613 - 3 = 18446744073709551610 + +18446744073709551614 - 18446744073709551613 = 1 +18446744073709551614 - 18446744073709551614 = 0 +18446744073709551614 - 18446744073709551615 = 18446744073709551615 +18446744073709551614 - 0 = 18446744073709551614 +18446744073709551614 - 1 = 18446744073709551613 +18446744073709551614 - 2 = 18446744073709551612 +18446744073709551614 - 3 = 18446744073709551611 + +18446744073709551615 - 18446744073709551613 = 2 +18446744073709551615 - 18446744073709551614 = 1 +18446744073709551615 - 18446744073709551615 = 0 +18446744073709551615 - 0 = 18446744073709551615 +18446744073709551615 - 1 = 18446744073709551614 +18446744073709551615 - 2 = 18446744073709551613 +18446744073709551615 - 3 = 18446744073709551612 + +0 - 18446744073709551613 = 3 +0 - 18446744073709551614 = 2 +0 - 18446744073709551615 = 1 +0 - 0 = 0 +0 - 1 = 18446744073709551615 +0 - 2 = 18446744073709551614 +0 - 3 = 18446744073709551613 + +1 - 18446744073709551613 = 4 +1 - 18446744073709551614 = 3 +1 - 18446744073709551615 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 18446744073709551615 +1 - 3 = 18446744073709551614 + +2 - 18446744073709551613 = 5 +2 - 18446744073709551614 = 4 +2 - 18446744073709551615 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 18446744073709551615 + +3 - 18446744073709551613 = 6 +3 - 18446744073709551614 = 5 +3 - 18446744073709551615 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +18446744073709551613 * 18446744073709551613 = 9 +18446744073709551613 * 18446744073709551614 = 6 +18446744073709551613 * 18446744073709551615 = 3 +18446744073709551613 * 0 = 0 +18446744073709551613 * 1 = 18446744073709551613 +18446744073709551613 * 2 = 18446744073709551610 +18446744073709551613 * 3 = 18446744073709551607 + +18446744073709551614 * 18446744073709551613 = 6 +18446744073709551614 * 18446744073709551614 = 4 +18446744073709551614 * 18446744073709551615 = 2 +18446744073709551614 * 0 = 0 +18446744073709551614 * 1 = 18446744073709551614 +18446744073709551614 * 2 = 18446744073709551612 +18446744073709551614 * 3 = 18446744073709551610 + +18446744073709551615 * 18446744073709551613 = 3 +18446744073709551615 * 18446744073709551614 = 2 +18446744073709551615 * 18446744073709551615 = 1 +18446744073709551615 * 0 = 0 +18446744073709551615 * 1 = 18446744073709551615 +18446744073709551615 * 2 = 18446744073709551614 +18446744073709551615 * 3 = 18446744073709551613 + +0 * 18446744073709551613 = 0 +0 * 18446744073709551614 = 0 +0 * 18446744073709551615 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 18446744073709551613 = 18446744073709551613 +1 * 18446744073709551614 = 18446744073709551614 +1 * 18446744073709551615 = 18446744073709551615 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 18446744073709551613 = 18446744073709551610 +2 * 18446744073709551614 = 18446744073709551612 +2 * 18446744073709551615 = 18446744073709551614 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 18446744073709551613 = 18446744073709551607 +3 * 18446744073709551614 = 18446744073709551610 +3 * 18446744073709551615 = 18446744073709551613 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 18446744073709551613 = 3 +negate 18446744073709551614 = 2 +negate 18446744073709551615 = 1 +negate 0 = 0 +negate 1 = 18446744073709551615 +negate 2 = 18446744073709551614 +negate 3 = 18446744073709551613 +# +testReal +toRational 18446744073709551613 = 18446744073709551613 % 1 +toRational 18446744073709551614 = 18446744073709551614 % 1 +toRational 18446744073709551615 = 18446744073709551615 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +18446744073709551613 `divMod` 18446744073709551613 = (1,0) +18446744073709551613 `divMod` 18446744073709551614 = (0,18446744073709551613) +18446744073709551613 `divMod` 18446744073709551615 = (0,18446744073709551613) +18446744073709551613 `divMod` 1 = (18446744073709551613,0) +18446744073709551613 `divMod` 2 = (9223372036854775806,1) +18446744073709551613 `divMod` 3 = (6148914691236517204,1) + +18446744073709551614 `divMod` 18446744073709551613 = (1,1) +18446744073709551614 `divMod` 18446744073709551614 = (1,0) +18446744073709551614 `divMod` 18446744073709551615 = (0,18446744073709551614) +18446744073709551614 `divMod` 1 = (18446744073709551614,0) +18446744073709551614 `divMod` 2 = (9223372036854775807,0) +18446744073709551614 `divMod` 3 = (6148914691236517204,2) + +18446744073709551615 `divMod` 18446744073709551613 = (1,2) +18446744073709551615 `divMod` 18446744073709551614 = (1,1) +18446744073709551615 `divMod` 18446744073709551615 = (1,0) +18446744073709551615 `divMod` 1 = (18446744073709551615,0) +18446744073709551615 `divMod` 2 = (9223372036854775807,1) +18446744073709551615 `divMod` 3 = (6148914691236517205,0) + +0 `divMod` 18446744073709551613 = (0,0) +0 `divMod` 18446744073709551614 = (0,0) +0 `divMod` 18446744073709551615 = (0,0) +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 18446744073709551613 = (0,1) +1 `divMod` 18446744073709551614 = (0,1) +1 `divMod` 18446744073709551615 = (0,1) +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 18446744073709551613 = (0,2) +2 `divMod` 18446744073709551614 = (0,2) +2 `divMod` 18446744073709551615 = (0,2) +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 18446744073709551613 = (0,3) +3 `divMod` 18446744073709551614 = (0,3) +3 `divMod` 18446744073709551615 = (0,3) +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +18446744073709551613 `div` 18446744073709551613 = 1 +18446744073709551613 `div` 18446744073709551614 = 0 +18446744073709551613 `div` 18446744073709551615 = 0 +18446744073709551613 `div` 1 = 18446744073709551613 +18446744073709551613 `div` 2 = 9223372036854775806 +18446744073709551613 `div` 3 = 6148914691236517204 + +18446744073709551614 `div` 18446744073709551613 = 1 +18446744073709551614 `div` 18446744073709551614 = 1 +18446744073709551614 `div` 18446744073709551615 = 0 +18446744073709551614 `div` 1 = 18446744073709551614 +18446744073709551614 `div` 2 = 9223372036854775807 +18446744073709551614 `div` 3 = 6148914691236517204 + +18446744073709551615 `div` 18446744073709551613 = 1 +18446744073709551615 `div` 18446744073709551614 = 1 +18446744073709551615 `div` 18446744073709551615 = 1 +18446744073709551615 `div` 1 = 18446744073709551615 +18446744073709551615 `div` 2 = 9223372036854775807 +18446744073709551615 `div` 3 = 6148914691236517205 + +0 `div` 18446744073709551613 = 0 +0 `div` 18446744073709551614 = 0 +0 `div` 18446744073709551615 = 0 +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 18446744073709551613 = 0 +1 `div` 18446744073709551614 = 0 +1 `div` 18446744073709551615 = 0 +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 18446744073709551613 = 0 +2 `div` 18446744073709551614 = 0 +2 `div` 18446744073709551615 = 0 +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 18446744073709551613 = 0 +3 `div` 18446744073709551614 = 0 +3 `div` 18446744073709551615 = 0 +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +18446744073709551613 `mod` 18446744073709551613 = 0 +18446744073709551613 `mod` 18446744073709551614 = 18446744073709551613 +18446744073709551613 `mod` 18446744073709551615 = 18446744073709551613 +18446744073709551613 `mod` 1 = 0 +18446744073709551613 `mod` 2 = 1 +18446744073709551613 `mod` 3 = 1 + +18446744073709551614 `mod` 18446744073709551613 = 1 +18446744073709551614 `mod` 18446744073709551614 = 0 +18446744073709551614 `mod` 18446744073709551615 = 18446744073709551614 +18446744073709551614 `mod` 1 = 0 +18446744073709551614 `mod` 2 = 0 +18446744073709551614 `mod` 3 = 2 + +18446744073709551615 `mod` 18446744073709551613 = 2 +18446744073709551615 `mod` 18446744073709551614 = 1 +18446744073709551615 `mod` 18446744073709551615 = 0 +18446744073709551615 `mod` 1 = 0 +18446744073709551615 `mod` 2 = 1 +18446744073709551615 `mod` 3 = 0 + +0 `mod` 18446744073709551613 = 0 +0 `mod` 18446744073709551614 = 0 +0 `mod` 18446744073709551615 = 0 +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 18446744073709551613 = 1 +1 `mod` 18446744073709551614 = 1 +1 `mod` 18446744073709551615 = 1 +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 18446744073709551613 = 2 +2 `mod` 18446744073709551614 = 2 +2 `mod` 18446744073709551615 = 2 +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 18446744073709551613 = 3 +3 `mod` 18446744073709551614 = 3 +3 `mod` 18446744073709551615 = 3 +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +18446744073709551613 `quotRem` 18446744073709551613 = (1,0) +18446744073709551613 `quotRem` 18446744073709551614 = (0,18446744073709551613) +18446744073709551613 `quotRem` 18446744073709551615 = (0,18446744073709551613) +18446744073709551613 `quotRem` 1 = (18446744073709551613,0) +18446744073709551613 `quotRem` 2 = (9223372036854775806,1) +18446744073709551613 `quotRem` 3 = (6148914691236517204,1) + +18446744073709551614 `quotRem` 18446744073709551613 = (1,1) +18446744073709551614 `quotRem` 18446744073709551614 = (1,0) +18446744073709551614 `quotRem` 18446744073709551615 = (0,18446744073709551614) +18446744073709551614 `quotRem` 1 = (18446744073709551614,0) +18446744073709551614 `quotRem` 2 = (9223372036854775807,0) +18446744073709551614 `quotRem` 3 = (6148914691236517204,2) + +18446744073709551615 `quotRem` 18446744073709551613 = (1,2) +18446744073709551615 `quotRem` 18446744073709551614 = (1,1) +18446744073709551615 `quotRem` 18446744073709551615 = (1,0) +18446744073709551615 `quotRem` 1 = (18446744073709551615,0) +18446744073709551615 `quotRem` 2 = (9223372036854775807,1) +18446744073709551615 `quotRem` 3 = (6148914691236517205,0) + +0 `quotRem` 18446744073709551613 = (0,0) +0 `quotRem` 18446744073709551614 = (0,0) +0 `quotRem` 18446744073709551615 = (0,0) +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 18446744073709551613 = (0,1) +1 `quotRem` 18446744073709551614 = (0,1) +1 `quotRem` 18446744073709551615 = (0,1) +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 18446744073709551613 = (0,2) +2 `quotRem` 18446744073709551614 = (0,2) +2 `quotRem` 18446744073709551615 = (0,2) +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 18446744073709551613 = (0,3) +3 `quotRem` 18446744073709551614 = (0,3) +3 `quotRem` 18446744073709551615 = (0,3) +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +18446744073709551613 `quot` 18446744073709551613 = 1 +18446744073709551613 `quot` 18446744073709551614 = 0 +18446744073709551613 `quot` 18446744073709551615 = 0 +18446744073709551613 `quot` 1 = 18446744073709551613 +18446744073709551613 `quot` 2 = 9223372036854775806 +18446744073709551613 `quot` 3 = 6148914691236517204 + +18446744073709551614 `quot` 18446744073709551613 = 1 +18446744073709551614 `quot` 18446744073709551614 = 1 +18446744073709551614 `quot` 18446744073709551615 = 0 +18446744073709551614 `quot` 1 = 18446744073709551614 +18446744073709551614 `quot` 2 = 9223372036854775807 +18446744073709551614 `quot` 3 = 6148914691236517204 + +18446744073709551615 `quot` 18446744073709551613 = 1 +18446744073709551615 `quot` 18446744073709551614 = 1 +18446744073709551615 `quot` 18446744073709551615 = 1 +18446744073709551615 `quot` 1 = 18446744073709551615 +18446744073709551615 `quot` 2 = 9223372036854775807 +18446744073709551615 `quot` 3 = 6148914691236517205 + +0 `quot` 18446744073709551613 = 0 +0 `quot` 18446744073709551614 = 0 +0 `quot` 18446744073709551615 = 0 +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 18446744073709551613 = 0 +1 `quot` 18446744073709551614 = 0 +1 `quot` 18446744073709551615 = 0 +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 18446744073709551613 = 0 +2 `quot` 18446744073709551614 = 0 +2 `quot` 18446744073709551615 = 0 +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 18446744073709551613 = 0 +3 `quot` 18446744073709551614 = 0 +3 `quot` 18446744073709551615 = 0 +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +18446744073709551613 `rem` 18446744073709551613 = 0 +18446744073709551613 `rem` 18446744073709551614 = 18446744073709551613 +18446744073709551613 `rem` 18446744073709551615 = 18446744073709551613 +18446744073709551613 `rem` 1 = 0 +18446744073709551613 `rem` 2 = 1 +18446744073709551613 `rem` 3 = 1 + +18446744073709551614 `rem` 18446744073709551613 = 1 +18446744073709551614 `rem` 18446744073709551614 = 0 +18446744073709551614 `rem` 18446744073709551615 = 18446744073709551614 +18446744073709551614 `rem` 1 = 0 +18446744073709551614 `rem` 2 = 0 +18446744073709551614 `rem` 3 = 2 + +18446744073709551615 `rem` 18446744073709551613 = 2 +18446744073709551615 `rem` 18446744073709551614 = 1 +18446744073709551615 `rem` 18446744073709551615 = 0 +18446744073709551615 `rem` 1 = 0 +18446744073709551615 `rem` 2 = 1 +18446744073709551615 `rem` 3 = 0 + +0 `rem` 18446744073709551613 = 0 +0 `rem` 18446744073709551614 = 0 +0 `rem` 18446744073709551615 = 0 +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 18446744073709551613 = 1 +1 `rem` 18446744073709551614 = 1 +1 `rem` 18446744073709551615 = 1 +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 18446744073709551613 = 2 +2 `rem` 18446744073709551614 = 2 +2 `rem` 18446744073709551615 = 2 +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 18446744073709551613 = 3 +3 `rem` 18446744073709551614 = 3 +3 `rem` 18446744073709551615 = 3 +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,18446744073709551615] +Int : [0,0,-1] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [0,0,-1] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [0,0,18446744073709551615] +testBits +18446744073709551613 .&. 18446744073709551613 = 18446744073709551613 +18446744073709551613 .&. 18446744073709551614 = 18446744073709551612 +18446744073709551613 .&. 18446744073709551615 = 18446744073709551613 +18446744073709551613 .&. 1 = 1 +18446744073709551613 .&. 2 = 0 +18446744073709551613 .&. 3 = 1 + +18446744073709551614 .&. 18446744073709551613 = 18446744073709551612 +18446744073709551614 .&. 18446744073709551614 = 18446744073709551614 +18446744073709551614 .&. 18446744073709551615 = 18446744073709551614 +18446744073709551614 .&. 1 = 0 +18446744073709551614 .&. 2 = 2 +18446744073709551614 .&. 3 = 2 + +18446744073709551615 .&. 18446744073709551613 = 18446744073709551613 +18446744073709551615 .&. 18446744073709551614 = 18446744073709551614 +18446744073709551615 .&. 18446744073709551615 = 18446744073709551615 +18446744073709551615 .&. 1 = 1 +18446744073709551615 .&. 2 = 2 +18446744073709551615 .&. 3 = 3 + +0 .&. 18446744073709551613 = 0 +0 .&. 18446744073709551614 = 0 +0 .&. 18446744073709551615 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 18446744073709551613 = 1 +1 .&. 18446744073709551614 = 0 +1 .&. 18446744073709551615 = 1 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 18446744073709551613 = 0 +2 .&. 18446744073709551614 = 2 +2 .&. 18446744073709551615 = 2 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 18446744073709551613 = 1 +3 .&. 18446744073709551614 = 2 +3 .&. 18446744073709551615 = 3 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +18446744073709551613 .|. 18446744073709551613 = 18446744073709551613 +18446744073709551613 .|. 18446744073709551614 = 18446744073709551615 +18446744073709551613 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551613 .|. 1 = 18446744073709551613 +18446744073709551613 .|. 2 = 18446744073709551615 +18446744073709551613 .|. 3 = 18446744073709551615 + +18446744073709551614 .|. 18446744073709551613 = 18446744073709551615 +18446744073709551614 .|. 18446744073709551614 = 18446744073709551614 +18446744073709551614 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551614 .|. 1 = 18446744073709551615 +18446744073709551614 .|. 2 = 18446744073709551614 +18446744073709551614 .|. 3 = 18446744073709551615 + +18446744073709551615 .|. 18446744073709551613 = 18446744073709551615 +18446744073709551615 .|. 18446744073709551614 = 18446744073709551615 +18446744073709551615 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551615 .|. 1 = 18446744073709551615 +18446744073709551615 .|. 2 = 18446744073709551615 +18446744073709551615 .|. 3 = 18446744073709551615 + +0 .|. 18446744073709551613 = 18446744073709551613 +0 .|. 18446744073709551614 = 18446744073709551614 +0 .|. 18446744073709551615 = 18446744073709551615 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 18446744073709551613 = 18446744073709551613 +1 .|. 18446744073709551614 = 18446744073709551615 +1 .|. 18446744073709551615 = 18446744073709551615 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 18446744073709551613 = 18446744073709551615 +2 .|. 18446744073709551614 = 18446744073709551614 +2 .|. 18446744073709551615 = 18446744073709551615 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 18446744073709551613 = 18446744073709551615 +3 .|. 18446744073709551614 = 18446744073709551615 +3 .|. 18446744073709551615 = 18446744073709551615 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +18446744073709551613 `xor` 18446744073709551613 = 0 +18446744073709551613 `xor` 18446744073709551614 = 3 +18446744073709551613 `xor` 18446744073709551615 = 2 +18446744073709551613 `xor` 1 = 18446744073709551612 +18446744073709551613 `xor` 2 = 18446744073709551615 +18446744073709551613 `xor` 3 = 18446744073709551614 + +18446744073709551614 `xor` 18446744073709551613 = 3 +18446744073709551614 `xor` 18446744073709551614 = 0 +18446744073709551614 `xor` 18446744073709551615 = 1 +18446744073709551614 `xor` 1 = 18446744073709551615 +18446744073709551614 `xor` 2 = 18446744073709551612 +18446744073709551614 `xor` 3 = 18446744073709551613 + +18446744073709551615 `xor` 18446744073709551613 = 2 +18446744073709551615 `xor` 18446744073709551614 = 1 +18446744073709551615 `xor` 18446744073709551615 = 0 +18446744073709551615 `xor` 1 = 18446744073709551614 +18446744073709551615 `xor` 2 = 18446744073709551613 +18446744073709551615 `xor` 3 = 18446744073709551612 + +0 `xor` 18446744073709551613 = 18446744073709551613 +0 `xor` 18446744073709551614 = 18446744073709551614 +0 `xor` 18446744073709551615 = 18446744073709551615 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 18446744073709551613 = 18446744073709551612 +1 `xor` 18446744073709551614 = 18446744073709551615 +1 `xor` 18446744073709551615 = 18446744073709551614 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 18446744073709551613 = 18446744073709551615 +2 `xor` 18446744073709551614 = 18446744073709551612 +2 `xor` 18446744073709551615 = 18446744073709551613 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 18446744073709551613 = 18446744073709551614 +3 `xor` 18446744073709551614 = 18446744073709551613 +3 `xor` 18446744073709551615 = 18446744073709551612 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 18446744073709551613 = 2 +complement 18446744073709551614 = 1 +complement 18446744073709551615 = 0 +complement 0 = 18446744073709551615 +complement 1 = 18446744073709551614 +complement 2 = 18446744073709551613 +complement 3 = 18446744073709551612 +# +18446744073709551613 `shiftL` 0 = 18446744073709551613 +18446744073709551613 `shiftL` 1 = 18446744073709551610 +18446744073709551613 `shiftL` 2 = 18446744073709551604 +18446744073709551613 `shiftL` 3 = 18446744073709551592 +18446744073709551613 `shiftL` 32 = 18446744060824649728 +18446744073709551613 `shiftL` 64 = 0 + +18446744073709551614 `shiftL` 0 = 18446744073709551614 +18446744073709551614 `shiftL` 1 = 18446744073709551612 +18446744073709551614 `shiftL` 2 = 18446744073709551608 +18446744073709551614 `shiftL` 3 = 18446744073709551600 +18446744073709551614 `shiftL` 32 = 18446744065119617024 +18446744073709551614 `shiftL` 64 = 0 + +18446744073709551615 `shiftL` 0 = 18446744073709551615 +18446744073709551615 `shiftL` 1 = 18446744073709551614 +18446744073709551615 `shiftL` 2 = 18446744073709551612 +18446744073709551615 `shiftL` 3 = 18446744073709551608 +18446744073709551615 `shiftL` 32 = 18446744069414584320 +18446744073709551615 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +18446744073709551613 `shiftR` 0 = 18446744073709551613 +18446744073709551613 `shiftR` 1 = 9223372036854775806 +18446744073709551613 `shiftR` 2 = 4611686018427387903 +18446744073709551613 `shiftR` 3 = 2305843009213693951 +18446744073709551613 `shiftR` 32 = 4294967295 +18446744073709551613 `shiftR` 64 = 0 + +18446744073709551614 `shiftR` 0 = 18446744073709551614 +18446744073709551614 `shiftR` 1 = 9223372036854775807 +18446744073709551614 `shiftR` 2 = 4611686018427387903 +18446744073709551614 `shiftR` 3 = 2305843009213693951 +18446744073709551614 `shiftR` 32 = 4294967295 +18446744073709551614 `shiftR` 64 = 0 + +18446744073709551615 `shiftR` 0 = 18446744073709551615 +18446744073709551615 `shiftR` 1 = 9223372036854775807 +18446744073709551615 `shiftR` 2 = 4611686018427387903 +18446744073709551615 `shiftR` 3 = 2305843009213693951 +18446744073709551615 `shiftR` 32 = 4294967295 +18446744073709551615 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +18446744073709551613 `rotate` -3 = 13835058055282163711 +18446744073709551613 `rotate` -2 = 9223372036854775807 +18446744073709551613 `rotate` -1 = 18446744073709551614 +18446744073709551613 `rotate` 0 = 18446744073709551613 +18446744073709551613 `rotate` 1 = 18446744073709551611 +18446744073709551613 `rotate` 2 = 18446744073709551607 +18446744073709551613 `rotate` 3 = 18446744073709551599 + +18446744073709551614 `rotate` -3 = 16140901064495857663 +18446744073709551614 `rotate` -2 = 13835058055282163711 +18446744073709551614 `rotate` -1 = 9223372036854775807 +18446744073709551614 `rotate` 0 = 18446744073709551614 +18446744073709551614 `rotate` 1 = 18446744073709551613 +18446744073709551614 `rotate` 2 = 18446744073709551611 +18446744073709551614 `rotate` 3 = 18446744073709551607 + +18446744073709551615 `rotate` -3 = 18446744073709551615 +18446744073709551615 `rotate` -2 = 18446744073709551615 +18446744073709551615 `rotate` -1 = 18446744073709551615 +18446744073709551615 `rotate` 0 = 18446744073709551615 +18446744073709551615 `rotate` 1 = 18446744073709551615 +18446744073709551615 `rotate` 2 = 18446744073709551615 +18446744073709551615 `rotate` 3 = 18446744073709551615 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = 9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = 9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = 13835058055282163712 +3 `rotate` -1 = 9223372036854775809 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +18446744073709551613 `setBit` 0 = 18446744073709551613 +18446744073709551613 `setBit` 1 = 18446744073709551615 +18446744073709551613 `setBit` 2 = 18446744073709551613 +18446744073709551613 `setBit` 3 = 18446744073709551613 +18446744073709551613 `setBit` 32 = 18446744073709551613 +18446744073709551613 `setBit` 64 = 18446744073709551613 + +18446744073709551614 `setBit` 0 = 18446744073709551615 +18446744073709551614 `setBit` 1 = 18446744073709551614 +18446744073709551614 `setBit` 2 = 18446744073709551614 +18446744073709551614 `setBit` 3 = 18446744073709551614 +18446744073709551614 `setBit` 32 = 18446744073709551614 +18446744073709551614 `setBit` 64 = 18446744073709551614 + +18446744073709551615 `setBit` 0 = 18446744073709551615 +18446744073709551615 `setBit` 1 = 18446744073709551615 +18446744073709551615 `setBit` 2 = 18446744073709551615 +18446744073709551615 `setBit` 3 = 18446744073709551615 +18446744073709551615 `setBit` 32 = 18446744073709551615 +18446744073709551615 `setBit` 64 = 18446744073709551615 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +18446744073709551613 `clearBit` 0 = 18446744073709551612 +18446744073709551613 `clearBit` 1 = 18446744073709551613 +18446744073709551613 `clearBit` 2 = 18446744073709551609 +18446744073709551613 `clearBit` 3 = 18446744073709551605 +18446744073709551613 `clearBit` 32 = 18446744069414584317 +18446744073709551613 `clearBit` 64 = 18446744073709551613 + +18446744073709551614 `clearBit` 0 = 18446744073709551614 +18446744073709551614 `clearBit` 1 = 18446744073709551612 +18446744073709551614 `clearBit` 2 = 18446744073709551610 +18446744073709551614 `clearBit` 3 = 18446744073709551606 +18446744073709551614 `clearBit` 32 = 18446744069414584318 +18446744073709551614 `clearBit` 64 = 18446744073709551614 + +18446744073709551615 `clearBit` 0 = 18446744073709551614 +18446744073709551615 `clearBit` 1 = 18446744073709551613 +18446744073709551615 `clearBit` 2 = 18446744073709551611 +18446744073709551615 `clearBit` 3 = 18446744073709551607 +18446744073709551615 `clearBit` 32 = 18446744069414584319 +18446744073709551615 `clearBit` 64 = 18446744073709551615 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +18446744073709551613 `complementBit` 0 = 18446744073709551612 +18446744073709551613 `complementBit` 1 = 18446744073709551615 +18446744073709551613 `complementBit` 2 = 18446744073709551609 +18446744073709551613 `complementBit` 3 = 18446744073709551605 +18446744073709551613 `complementBit` 32 = 18446744069414584317 +18446744073709551613 `complementBit` 64 = 18446744073709551613 + +18446744073709551614 `complementBit` 0 = 18446744073709551615 +18446744073709551614 `complementBit` 1 = 18446744073709551612 +18446744073709551614 `complementBit` 2 = 18446744073709551610 +18446744073709551614 `complementBit` 3 = 18446744073709551606 +18446744073709551614 `complementBit` 32 = 18446744069414584318 +18446744073709551614 `complementBit` 64 = 18446744073709551614 + +18446744073709551615 `complementBit` 0 = 18446744073709551614 +18446744073709551615 `complementBit` 1 = 18446744073709551613 +18446744073709551615 `complementBit` 2 = 18446744073709551611 +18446744073709551615 `complementBit` 3 = 18446744073709551607 +18446744073709551615 `complementBit` 32 = 18446744069414584319 +18446744073709551615 `complementBit` 64 = 18446744073709551615 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +18446744073709551613 `testBit` 0 = True +18446744073709551613 `testBit` 1 = False +18446744073709551613 `testBit` 2 = True +18446744073709551613 `testBit` 3 = True +18446744073709551613 `testBit` 32 = True +18446744073709551613 `testBit` 64 = False + +18446744073709551614 `testBit` 0 = False +18446744073709551614 `testBit` 1 = True +18446744073709551614 `testBit` 2 = True +18446744073709551614 `testBit` 3 = True +18446744073709551614 `testBit` 32 = True +18446744073709551614 `testBit` 64 = False + +18446744073709551615 `testBit` 0 = True +18446744073709551615 `testBit` 1 = True +18446744073709551615 `testBit` 2 = True +18446744073709551615 `testBit` 3 = True +18446744073709551615 `testBit` 32 = True +18446744073709551615 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 18446744073709551613 = 64 +bitSize 18446744073709551614 = 64 +bitSize 18446744073709551615 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned 18446744073709551613 = False +isSigned 18446744073709551614 = False +isSigned 18446744073709551615 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Integer +-------------------------------- +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = -55340232221128654848 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = -36893488147419103232 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = -18446744073709551616 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 18446744073709551616 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 36893488147419103232 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 55340232221128654848 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -1 +-3 `rotate` -2 = -1 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -6 +-3 `rotate` 2 = -12 +-3 `rotate` 3 = -24 + +-2 `rotate` -3 = -1 +-2 `rotate` -2 = -1 +-2 `rotate` -1 = -1 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -4 +-2 `rotate` 2 = -8 +-2 `rotate` 3 = -16 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -2 +-1 `rotate` 2 = -4 +-1 `rotate` 3 = -8 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 0 +1 `rotate` -2 = 0 +1 `rotate` -1 = 0 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 0 +2 `rotate` -2 = 0 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 0 +3 `rotate` -2 = 0 +3 `rotate` -1 = 1 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 18446744073709551616 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 18446744073709551617 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 18446744073709551618 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 18446744073709551619 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -18446744073709551619 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -18446744073709551618 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -18446744073709551617 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -18446744073709551619 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -18446744073709551618 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -18446744073709551617 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 18446744073709551616 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 18446744073709551617 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 18446744073709551618 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 18446744073709551619 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = True + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = True + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = True + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# diff --git a/testsuite/tests/numeric/should_run/arith011.stdout-mips-sgi-irix b/testsuite/tests/numeric/should_run/arith011.stdout-mips-sgi-irix new file mode 100644 index 0000000000..0e86320b3a --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith011.stdout-mips-sgi-irix @@ -0,0 +1,15138 @@ +-------------------------------- +--Testing Int +-------------------------------- +testBounded +(9223372036854775807,-9223372036854775808,-9223372036854775807) +(9223372036854775806,9223372036854775807,-9223372036854775808) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-9223372036854775808,0,9223372036854775807] +Int : [-9223372036854775808,0,9223372036854775807] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [-9223372036854775808,0,9223372036854775807] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [9223372036854775808,0,9223372036854775807] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -4611686018427387905 +-3 `rotate` -2 = 9223372036854775807 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 + +-2 `rotate` -3 = -2305843009213693953 +-2 `rotate` -2 = -4611686018427387905 +-2 `rotate` -1 = 9223372036854775807 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = -9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = -9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = -4611686018427387904 +3 `rotate` -1 = -9223372036854775807 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 64 +bitSize -2 = 64 +bitSize -1 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int8 +-------------------------------- +testBounded +(127,-128,-127) +(126,127,-128) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-128,0,127] +Int : [-128,0,127] +Int8 : [-128,0,127] +Int16 : [-128,0,127] +Int32 : [-128,0,127] +Int64 : [-128,0,127] +Word8 : [128,0,127] +Word16 : [65408,0,127] +Word32 : [4294967168,0,127] +Word64 : [18446744073709551488,0,127] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -65 +-3 `rotate` -2 = 127 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 + +-2 `rotate` -3 = -33 +-2 `rotate` -2 = -65 +-2 `rotate` -1 = 127 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 32 +1 `rotate` -2 = 64 +1 `rotate` -1 = -128 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 64 +2 `rotate` -2 = -128 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 96 +3 `rotate` -2 = -64 +3 `rotate` -1 = -127 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 8 +bitSize -2 = 8 +bitSize -1 = 8 +bitSize 0 = 8 +bitSize 1 = 8 +bitSize 2 = 8 +bitSize 3 = 8 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int16 +-------------------------------- +testBounded +(32767,-32768,-32767) +(32766,32767,-32768) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-32768,0,32767] +Int : [-32768,0,32767] +Int8 : [0,0,-1] +Int16 : [-32768,0,32767] +Int32 : [-32768,0,32767] +Int64 : [-32768,0,32767] +Word8 : [0,0,255] +Word16 : [32768,0,32767] +Word32 : [4294934528,0,32767] +Word64 : [18446744073709518848,0,32767] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -16385 +-3 `rotate` -2 = 32767 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 + +-2 `rotate` -3 = -8193 +-2 `rotate` -2 = -16385 +-2 `rotate` -1 = 32767 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 8192 +1 `rotate` -2 = 16384 +1 `rotate` -1 = -32768 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 16384 +2 `rotate` -2 = -32768 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 24576 +3 `rotate` -2 = -16384 +3 `rotate` -1 = -32767 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 16 +bitSize -2 = 16 +bitSize -1 = 16 +bitSize 0 = 16 +bitSize 1 = 16 +bitSize 2 = 16 +bitSize 3 = 16 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int32 +-------------------------------- +testBounded +(2147483647,-2147483648,-2147483647) +(2147483646,2147483647,-2147483648) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-2147483648,0,2147483647] +Int : [-2147483648,0,2147483647] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [-2147483648,0,2147483647] +Int64 : [-2147483648,0,2147483647] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [2147483648,0,2147483647] +Word64 : [18446744071562067968,0,2147483647] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -1073741825 +-3 `rotate` -2 = 2147483647 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 + +-2 `rotate` -3 = -536870913 +-2 `rotate` -2 = -1073741825 +-2 `rotate` -1 = 2147483647 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 536870912 +1 `rotate` -2 = 1073741824 +1 `rotate` -1 = -2147483648 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 1073741824 +2 `rotate` -2 = -2147483648 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 1610612736 +3 `rotate` -2 = -1073741824 +3 `rotate` -1 = -2147483647 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 32 +bitSize -2 = 32 +bitSize -1 = 32 +bitSize 0 = 32 +bitSize 1 = 32 +bitSize 2 = 32 +bitSize 3 = 32 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int64 +-------------------------------- +testBounded +(9223372036854775807,-9223372036854775808,-9223372036854775807) +(9223372036854775806,9223372036854775807,-9223372036854775808) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-9223372036854775808,0,9223372036854775807] +Int : [-9223372036854775808,0,9223372036854775807] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [-9223372036854775808,0,9223372036854775807] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [9223372036854775808,0,9223372036854775807] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -4611686018427387905 +-3 `rotate` -2 = 9223372036854775807 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 + +-2 `rotate` -3 = -2305843009213693953 +-2 `rotate` -2 = -4611686018427387905 +-2 `rotate` -1 = 9223372036854775807 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = -9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = -9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = -4611686018427387904 +3 `rotate` -1 = -9223372036854775807 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 64 +bitSize -2 = 64 +bitSize -1 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Word8 +-------------------------------- +testBounded +(255,0,1) +(254,255,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[253,254,255,0,1,2,3] +[253,254,255,0,1,2,3] +testEq +253 == 253 = True +253 == 254 = False +253 == 255 = False +253 == 0 = False +253 == 1 = False +253 == 2 = False +253 == 3 = False + +254 == 253 = False +254 == 254 = True +254 == 255 = False +254 == 0 = False +254 == 1 = False +254 == 2 = False +254 == 3 = False + +255 == 253 = False +255 == 254 = False +255 == 255 = True +255 == 0 = False +255 == 1 = False +255 == 2 = False +255 == 3 = False + +0 == 253 = False +0 == 254 = False +0 == 255 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 253 = False +1 == 254 = False +1 == 255 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 253 = False +2 == 254 = False +2 == 255 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 253 = False +3 == 254 = False +3 == 255 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +253 /= 253 = False +253 /= 254 = True +253 /= 255 = True +253 /= 0 = True +253 /= 1 = True +253 /= 2 = True +253 /= 3 = True + +254 /= 253 = True +254 /= 254 = False +254 /= 255 = True +254 /= 0 = True +254 /= 1 = True +254 /= 2 = True +254 /= 3 = True + +255 /= 253 = True +255 /= 254 = True +255 /= 255 = False +255 /= 0 = True +255 /= 1 = True +255 /= 2 = True +255 /= 3 = True + +0 /= 253 = True +0 /= 254 = True +0 /= 255 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 253 = True +1 /= 254 = True +1 /= 255 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 253 = True +2 /= 254 = True +2 /= 255 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 253 = True +3 /= 254 = True +3 /= 255 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +253 <= 253 = True +253 <= 254 = True +253 <= 255 = True +253 <= 0 = False +253 <= 1 = False +253 <= 2 = False +253 <= 3 = False + +254 <= 253 = False +254 <= 254 = True +254 <= 255 = True +254 <= 0 = False +254 <= 1 = False +254 <= 2 = False +254 <= 3 = False + +255 <= 253 = False +255 <= 254 = False +255 <= 255 = True +255 <= 0 = False +255 <= 1 = False +255 <= 2 = False +255 <= 3 = False + +0 <= 253 = True +0 <= 254 = True +0 <= 255 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 253 = True +1 <= 254 = True +1 <= 255 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 253 = True +2 <= 254 = True +2 <= 255 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 253 = True +3 <= 254 = True +3 <= 255 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +253 < 253 = False +253 < 254 = True +253 < 255 = True +253 < 0 = False +253 < 1 = False +253 < 2 = False +253 < 3 = False + +254 < 253 = False +254 < 254 = False +254 < 255 = True +254 < 0 = False +254 < 1 = False +254 < 2 = False +254 < 3 = False + +255 < 253 = False +255 < 254 = False +255 < 255 = False +255 < 0 = False +255 < 1 = False +255 < 2 = False +255 < 3 = False + +0 < 253 = True +0 < 254 = True +0 < 255 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 253 = True +1 < 254 = True +1 < 255 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 253 = True +2 < 254 = True +2 < 255 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 253 = True +3 < 254 = True +3 < 255 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +253 > 253 = False +253 > 254 = False +253 > 255 = False +253 > 0 = True +253 > 1 = True +253 > 2 = True +253 > 3 = True + +254 > 253 = True +254 > 254 = False +254 > 255 = False +254 > 0 = True +254 > 1 = True +254 > 2 = True +254 > 3 = True + +255 > 253 = True +255 > 254 = True +255 > 255 = False +255 > 0 = True +255 > 1 = True +255 > 2 = True +255 > 3 = True + +0 > 253 = False +0 > 254 = False +0 > 255 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 253 = False +1 > 254 = False +1 > 255 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 253 = False +2 > 254 = False +2 > 255 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 253 = False +3 > 254 = False +3 > 255 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +253 >= 253 = True +253 >= 254 = False +253 >= 255 = False +253 >= 0 = True +253 >= 1 = True +253 >= 2 = True +253 >= 3 = True + +254 >= 253 = True +254 >= 254 = True +254 >= 255 = False +254 >= 0 = True +254 >= 1 = True +254 >= 2 = True +254 >= 3 = True + +255 >= 253 = True +255 >= 254 = True +255 >= 255 = True +255 >= 0 = True +255 >= 1 = True +255 >= 2 = True +255 >= 3 = True + +0 >= 253 = False +0 >= 254 = False +0 >= 255 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 253 = False +1 >= 254 = False +1 >= 255 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 253 = False +2 >= 254 = False +2 >= 255 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 253 = False +3 >= 254 = False +3 >= 255 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +253 `compare` 253 = EQ +253 `compare` 254 = LT +253 `compare` 255 = LT +253 `compare` 0 = GT +253 `compare` 1 = GT +253 `compare` 2 = GT +253 `compare` 3 = GT + +254 `compare` 253 = GT +254 `compare` 254 = EQ +254 `compare` 255 = LT +254 `compare` 0 = GT +254 `compare` 1 = GT +254 `compare` 2 = GT +254 `compare` 3 = GT + +255 `compare` 253 = GT +255 `compare` 254 = GT +255 `compare` 255 = EQ +255 `compare` 0 = GT +255 `compare` 1 = GT +255 `compare` 2 = GT +255 `compare` 3 = GT + +0 `compare` 253 = LT +0 `compare` 254 = LT +0 `compare` 255 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 253 = LT +1 `compare` 254 = LT +1 `compare` 255 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 253 = LT +2 `compare` 254 = LT +2 `compare` 255 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 253 = LT +3 `compare` 254 = LT +3 `compare` 255 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +253 + 253 = 250 +253 + 254 = 251 +253 + 255 = 252 +253 + 0 = 253 +253 + 1 = 254 +253 + 2 = 255 +253 + 3 = 0 + +254 + 253 = 251 +254 + 254 = 252 +254 + 255 = 253 +254 + 0 = 254 +254 + 1 = 255 +254 + 2 = 0 +254 + 3 = 1 + +255 + 253 = 252 +255 + 254 = 253 +255 + 255 = 254 +255 + 0 = 255 +255 + 1 = 0 +255 + 2 = 1 +255 + 3 = 2 + +0 + 253 = 253 +0 + 254 = 254 +0 + 255 = 255 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 253 = 254 +1 + 254 = 255 +1 + 255 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 253 = 255 +2 + 254 = 0 +2 + 255 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 253 = 0 +3 + 254 = 1 +3 + 255 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +253 - 253 = 0 +253 - 254 = 255 +253 - 255 = 254 +253 - 0 = 253 +253 - 1 = 252 +253 - 2 = 251 +253 - 3 = 250 + +254 - 253 = 1 +254 - 254 = 0 +254 - 255 = 255 +254 - 0 = 254 +254 - 1 = 253 +254 - 2 = 252 +254 - 3 = 251 + +255 - 253 = 2 +255 - 254 = 1 +255 - 255 = 0 +255 - 0 = 255 +255 - 1 = 254 +255 - 2 = 253 +255 - 3 = 252 + +0 - 253 = 3 +0 - 254 = 2 +0 - 255 = 1 +0 - 0 = 0 +0 - 1 = 255 +0 - 2 = 254 +0 - 3 = 253 + +1 - 253 = 4 +1 - 254 = 3 +1 - 255 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 255 +1 - 3 = 254 + +2 - 253 = 5 +2 - 254 = 4 +2 - 255 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 255 + +3 - 253 = 6 +3 - 254 = 5 +3 - 255 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +253 * 253 = 9 +253 * 254 = 6 +253 * 255 = 3 +253 * 0 = 0 +253 * 1 = 253 +253 * 2 = 250 +253 * 3 = 247 + +254 * 253 = 6 +254 * 254 = 4 +254 * 255 = 2 +254 * 0 = 0 +254 * 1 = 254 +254 * 2 = 252 +254 * 3 = 250 + +255 * 253 = 3 +255 * 254 = 2 +255 * 255 = 1 +255 * 0 = 0 +255 * 1 = 255 +255 * 2 = 254 +255 * 3 = 253 + +0 * 253 = 0 +0 * 254 = 0 +0 * 255 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 253 = 253 +1 * 254 = 254 +1 * 255 = 255 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 253 = 250 +2 * 254 = 252 +2 * 255 = 254 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 253 = 247 +3 * 254 = 250 +3 * 255 = 253 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 253 = 3 +negate 254 = 2 +negate 255 = 1 +negate 0 = 0 +negate 1 = 255 +negate 2 = 254 +negate 3 = 253 +# +testReal +toRational 253 = 253 % 1 +toRational 254 = 254 % 1 +toRational 255 = 255 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +253 `divMod` 253 = (1,0) +253 `divMod` 254 = (0,253) +253 `divMod` 255 = (0,253) +253 `divMod` 0 = divide by zero +253 `divMod` 1 = (253,0) +253 `divMod` 2 = (126,1) +253 `divMod` 3 = (84,1) + +254 `divMod` 253 = (1,1) +254 `divMod` 254 = (1,0) +254 `divMod` 255 = (0,254) +254 `divMod` 0 = divide by zero +254 `divMod` 1 = (254,0) +254 `divMod` 2 = (127,0) +254 `divMod` 3 = (84,2) + +255 `divMod` 253 = (1,2) +255 `divMod` 254 = (1,1) +255 `divMod` 255 = (1,0) +255 `divMod` 0 = divide by zero +255 `divMod` 1 = (255,0) +255 `divMod` 2 = (127,1) +255 `divMod` 3 = (85,0) + +0 `divMod` 253 = (0,0) +0 `divMod` 254 = (0,0) +0 `divMod` 255 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 253 = (0,1) +1 `divMod` 254 = (0,1) +1 `divMod` 255 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 253 = (0,2) +2 `divMod` 254 = (0,2) +2 `divMod` 255 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 253 = (0,3) +3 `divMod` 254 = (0,3) +3 `divMod` 255 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +253 `div` 253 = 1 +253 `div` 254 = 0 +253 `div` 255 = 0 +253 `div` 0 = divide by zero +253 `div` 1 = 253 +253 `div` 2 = 126 +253 `div` 3 = 84 + +254 `div` 253 = 1 +254 `div` 254 = 1 +254 `div` 255 = 0 +254 `div` 0 = divide by zero +254 `div` 1 = 254 +254 `div` 2 = 127 +254 `div` 3 = 84 + +255 `div` 253 = 1 +255 `div` 254 = 1 +255 `div` 255 = 1 +255 `div` 0 = divide by zero +255 `div` 1 = 255 +255 `div` 2 = 127 +255 `div` 3 = 85 + +0 `div` 253 = 0 +0 `div` 254 = 0 +0 `div` 255 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 253 = 0 +1 `div` 254 = 0 +1 `div` 255 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 253 = 0 +2 `div` 254 = 0 +2 `div` 255 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 253 = 0 +3 `div` 254 = 0 +3 `div` 255 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +253 `mod` 253 = 0 +253 `mod` 254 = 253 +253 `mod` 255 = 253 +253 `mod` 0 = divide by zero +253 `mod` 1 = 0 +253 `mod` 2 = 1 +253 `mod` 3 = 1 + +254 `mod` 253 = 1 +254 `mod` 254 = 0 +254 `mod` 255 = 254 +254 `mod` 0 = divide by zero +254 `mod` 1 = 0 +254 `mod` 2 = 0 +254 `mod` 3 = 2 + +255 `mod` 253 = 2 +255 `mod` 254 = 1 +255 `mod` 255 = 0 +255 `mod` 0 = divide by zero +255 `mod` 1 = 0 +255 `mod` 2 = 1 +255 `mod` 3 = 0 + +0 `mod` 253 = 0 +0 `mod` 254 = 0 +0 `mod` 255 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 253 = 1 +1 `mod` 254 = 1 +1 `mod` 255 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 253 = 2 +2 `mod` 254 = 2 +2 `mod` 255 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 253 = 3 +3 `mod` 254 = 3 +3 `mod` 255 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +253 `quotRem` 253 = (1,0) +253 `quotRem` 254 = (0,253) +253 `quotRem` 255 = (0,253) +253 `quotRem` 0 = divide by zero +253 `quotRem` 1 = (253,0) +253 `quotRem` 2 = (126,1) +253 `quotRem` 3 = (84,1) + +254 `quotRem` 253 = (1,1) +254 `quotRem` 254 = (1,0) +254 `quotRem` 255 = (0,254) +254 `quotRem` 0 = divide by zero +254 `quotRem` 1 = (254,0) +254 `quotRem` 2 = (127,0) +254 `quotRem` 3 = (84,2) + +255 `quotRem` 253 = (1,2) +255 `quotRem` 254 = (1,1) +255 `quotRem` 255 = (1,0) +255 `quotRem` 0 = divide by zero +255 `quotRem` 1 = (255,0) +255 `quotRem` 2 = (127,1) +255 `quotRem` 3 = (85,0) + +0 `quotRem` 253 = (0,0) +0 `quotRem` 254 = (0,0) +0 `quotRem` 255 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 253 = (0,1) +1 `quotRem` 254 = (0,1) +1 `quotRem` 255 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 253 = (0,2) +2 `quotRem` 254 = (0,2) +2 `quotRem` 255 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 253 = (0,3) +3 `quotRem` 254 = (0,3) +3 `quotRem` 255 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +253 `quot` 253 = 1 +253 `quot` 254 = 0 +253 `quot` 255 = 0 +253 `quot` 0 = divide by zero +253 `quot` 1 = 253 +253 `quot` 2 = 126 +253 `quot` 3 = 84 + +254 `quot` 253 = 1 +254 `quot` 254 = 1 +254 `quot` 255 = 0 +254 `quot` 0 = divide by zero +254 `quot` 1 = 254 +254 `quot` 2 = 127 +254 `quot` 3 = 84 + +255 `quot` 253 = 1 +255 `quot` 254 = 1 +255 `quot` 255 = 1 +255 `quot` 0 = divide by zero +255 `quot` 1 = 255 +255 `quot` 2 = 127 +255 `quot` 3 = 85 + +0 `quot` 253 = 0 +0 `quot` 254 = 0 +0 `quot` 255 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 253 = 0 +1 `quot` 254 = 0 +1 `quot` 255 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 253 = 0 +2 `quot` 254 = 0 +2 `quot` 255 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 253 = 0 +3 `quot` 254 = 0 +3 `quot` 255 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +253 `rem` 253 = 0 +253 `rem` 254 = 253 +253 `rem` 255 = 253 +253 `rem` 0 = divide by zero +253 `rem` 1 = 0 +253 `rem` 2 = 1 +253 `rem` 3 = 1 + +254 `rem` 253 = 1 +254 `rem` 254 = 0 +254 `rem` 255 = 254 +254 `rem` 0 = divide by zero +254 `rem` 1 = 0 +254 `rem` 2 = 0 +254 `rem` 3 = 2 + +255 `rem` 253 = 2 +255 `rem` 254 = 1 +255 `rem` 255 = 0 +255 `rem` 0 = divide by zero +255 `rem` 1 = 0 +255 `rem` 2 = 1 +255 `rem` 3 = 0 + +0 `rem` 253 = 0 +0 `rem` 254 = 0 +0 `rem` 255 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 253 = 1 +1 `rem` 254 = 1 +1 `rem` 255 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 253 = 2 +2 `rem` 254 = 2 +2 `rem` 255 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 253 = 3 +3 `rem` 254 = 3 +3 `rem` 255 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,255] +Int : [0,0,255] +Int8 : [0,0,-1] +Int16 : [0,0,255] +Int32 : [0,0,255] +Int64 : [0,0,255] +Word8 : [0,0,255] +Word16 : [0,0,255] +Word32 : [0,0,255] +Word64 : [0,0,255] +testBits +253 .&. 253 = 253 +253 .&. 254 = 252 +253 .&. 255 = 253 +253 .&. 0 = 0 +253 .&. 1 = 1 +253 .&. 2 = 0 +253 .&. 3 = 1 + +254 .&. 253 = 252 +254 .&. 254 = 254 +254 .&. 255 = 254 +254 .&. 0 = 0 +254 .&. 1 = 0 +254 .&. 2 = 2 +254 .&. 3 = 2 + +255 .&. 253 = 253 +255 .&. 254 = 254 +255 .&. 255 = 255 +255 .&. 0 = 0 +255 .&. 1 = 1 +255 .&. 2 = 2 +255 .&. 3 = 3 + +0 .&. 253 = 0 +0 .&. 254 = 0 +0 .&. 255 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 253 = 1 +1 .&. 254 = 0 +1 .&. 255 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 253 = 0 +2 .&. 254 = 2 +2 .&. 255 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 253 = 1 +3 .&. 254 = 2 +3 .&. 255 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +253 .|. 253 = 253 +253 .|. 254 = 255 +253 .|. 255 = 255 +253 .|. 0 = 253 +253 .|. 1 = 253 +253 .|. 2 = 255 +253 .|. 3 = 255 + +254 .|. 253 = 255 +254 .|. 254 = 254 +254 .|. 255 = 255 +254 .|. 0 = 254 +254 .|. 1 = 255 +254 .|. 2 = 254 +254 .|. 3 = 255 + +255 .|. 253 = 255 +255 .|. 254 = 255 +255 .|. 255 = 255 +255 .|. 0 = 255 +255 .|. 1 = 255 +255 .|. 2 = 255 +255 .|. 3 = 255 + +0 .|. 253 = 253 +0 .|. 254 = 254 +0 .|. 255 = 255 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 253 = 253 +1 .|. 254 = 255 +1 .|. 255 = 255 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 253 = 255 +2 .|. 254 = 254 +2 .|. 255 = 255 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 253 = 255 +3 .|. 254 = 255 +3 .|. 255 = 255 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +253 `xor` 253 = 0 +253 `xor` 254 = 3 +253 `xor` 255 = 2 +253 `xor` 0 = 253 +253 `xor` 1 = 252 +253 `xor` 2 = 255 +253 `xor` 3 = 254 + +254 `xor` 253 = 3 +254 `xor` 254 = 0 +254 `xor` 255 = 1 +254 `xor` 0 = 254 +254 `xor` 1 = 255 +254 `xor` 2 = 252 +254 `xor` 3 = 253 + +255 `xor` 253 = 2 +255 `xor` 254 = 1 +255 `xor` 255 = 0 +255 `xor` 0 = 255 +255 `xor` 1 = 254 +255 `xor` 2 = 253 +255 `xor` 3 = 252 + +0 `xor` 253 = 253 +0 `xor` 254 = 254 +0 `xor` 255 = 255 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 253 = 252 +1 `xor` 254 = 255 +1 `xor` 255 = 254 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 253 = 255 +2 `xor` 254 = 252 +2 `xor` 255 = 253 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 253 = 254 +3 `xor` 254 = 253 +3 `xor` 255 = 252 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 253 = 2 +complement 254 = 1 +complement 255 = 0 +complement 0 = 255 +complement 1 = 254 +complement 2 = 253 +complement 3 = 252 +# +253 `shiftL` 0 = 253 +253 `shiftL` 1 = 250 +253 `shiftL` 2 = 244 +253 `shiftL` 3 = 232 +253 `shiftL` 32 = 0 +253 `shiftL` 64 = 0 + +254 `shiftL` 0 = 254 +254 `shiftL` 1 = 252 +254 `shiftL` 2 = 248 +254 `shiftL` 3 = 240 +254 `shiftL` 32 = 0 +254 `shiftL` 64 = 0 + +255 `shiftL` 0 = 255 +255 `shiftL` 1 = 254 +255 `shiftL` 2 = 252 +255 `shiftL` 3 = 248 +255 `shiftL` 32 = 0 +255 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +253 `shiftR` 0 = 253 +253 `shiftR` 1 = 126 +253 `shiftR` 2 = 63 +253 `shiftR` 3 = 31 +253 `shiftR` 32 = 0 +253 `shiftR` 64 = 0 + +254 `shiftR` 0 = 254 +254 `shiftR` 1 = 127 +254 `shiftR` 2 = 63 +254 `shiftR` 3 = 31 +254 `shiftR` 32 = 0 +254 `shiftR` 64 = 0 + +255 `shiftR` 0 = 255 +255 `shiftR` 1 = 127 +255 `shiftR` 2 = 63 +255 `shiftR` 3 = 31 +255 `shiftR` 32 = 0 +255 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +253 `rotate` -3 = 191 +253 `rotate` -2 = 127 +253 `rotate` -1 = 254 +253 `rotate` 0 = 253 +253 `rotate` 1 = 251 +253 `rotate` 2 = 247 +253 `rotate` 3 = 239 + +254 `rotate` -3 = 223 +254 `rotate` -2 = 191 +254 `rotate` -1 = 127 +254 `rotate` 0 = 254 +254 `rotate` 1 = 253 +254 `rotate` 2 = 251 +254 `rotate` 3 = 247 + +255 `rotate` -3 = 255 +255 `rotate` -2 = 255 +255 `rotate` -1 = 255 +255 `rotate` 0 = 255 +255 `rotate` 1 = 255 +255 `rotate` 2 = 255 +255 `rotate` 3 = 255 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 32 +1 `rotate` -2 = 64 +1 `rotate` -1 = 128 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 64 +2 `rotate` -2 = 128 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 96 +3 `rotate` -2 = 192 +3 `rotate` -1 = 129 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +253 `setBit` 0 = 253 +253 `setBit` 1 = 255 +253 `setBit` 2 = 253 +253 `setBit` 3 = 253 +253 `setBit` 32 = 253 +253 `setBit` 64 = 253 + +254 `setBit` 0 = 255 +254 `setBit` 1 = 254 +254 `setBit` 2 = 254 +254 `setBit` 3 = 254 +254 `setBit` 32 = 254 +254 `setBit` 64 = 254 + +255 `setBit` 0 = 255 +255 `setBit` 1 = 255 +255 `setBit` 2 = 255 +255 `setBit` 3 = 255 +255 `setBit` 32 = 255 +255 `setBit` 64 = 255 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +253 `clearBit` 0 = 252 +253 `clearBit` 1 = 253 +253 `clearBit` 2 = 249 +253 `clearBit` 3 = 245 +253 `clearBit` 32 = 253 +253 `clearBit` 64 = 253 + +254 `clearBit` 0 = 254 +254 `clearBit` 1 = 252 +254 `clearBit` 2 = 250 +254 `clearBit` 3 = 246 +254 `clearBit` 32 = 254 +254 `clearBit` 64 = 254 + +255 `clearBit` 0 = 254 +255 `clearBit` 1 = 253 +255 `clearBit` 2 = 251 +255 `clearBit` 3 = 247 +255 `clearBit` 32 = 255 +255 `clearBit` 64 = 255 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +253 `complementBit` 0 = 252 +253 `complementBit` 1 = 255 +253 `complementBit` 2 = 249 +253 `complementBit` 3 = 245 +253 `complementBit` 32 = 253 +253 `complementBit` 64 = 253 + +254 `complementBit` 0 = 255 +254 `complementBit` 1 = 252 +254 `complementBit` 2 = 250 +254 `complementBit` 3 = 246 +254 `complementBit` 32 = 254 +254 `complementBit` 64 = 254 + +255 `complementBit` 0 = 254 +255 `complementBit` 1 = 253 +255 `complementBit` 2 = 251 +255 `complementBit` 3 = 247 +255 `complementBit` 32 = 255 +255 `complementBit` 64 = 255 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +253 `testBit` 0 = True +253 `testBit` 1 = False +253 `testBit` 2 = True +253 `testBit` 3 = True +253 `testBit` 32 = False +253 `testBit` 64 = False + +254 `testBit` 0 = False +254 `testBit` 1 = True +254 `testBit` 2 = True +254 `testBit` 3 = True +254 `testBit` 32 = False +254 `testBit` 64 = False + +255 `testBit` 0 = True +255 `testBit` 1 = True +255 `testBit` 2 = True +255 `testBit` 3 = True +255 `testBit` 32 = False +255 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 253 = 8 +bitSize 254 = 8 +bitSize 255 = 8 +bitSize 0 = 8 +bitSize 1 = 8 +bitSize 2 = 8 +bitSize 3 = 8 +# +isSigned 253 = False +isSigned 254 = False +isSigned 255 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word16 +-------------------------------- +testBounded +(65535,0,1) +(65534,65535,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[65533,65534,65535,0,1,2,3] +[65533,65534,65535,0,1,2,3] +testEq +65533 == 65533 = True +65533 == 65534 = False +65533 == 65535 = False +65533 == 0 = False +65533 == 1 = False +65533 == 2 = False +65533 == 3 = False + +65534 == 65533 = False +65534 == 65534 = True +65534 == 65535 = False +65534 == 0 = False +65534 == 1 = False +65534 == 2 = False +65534 == 3 = False + +65535 == 65533 = False +65535 == 65534 = False +65535 == 65535 = True +65535 == 0 = False +65535 == 1 = False +65535 == 2 = False +65535 == 3 = False + +0 == 65533 = False +0 == 65534 = False +0 == 65535 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 65533 = False +1 == 65534 = False +1 == 65535 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 65533 = False +2 == 65534 = False +2 == 65535 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 65533 = False +3 == 65534 = False +3 == 65535 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +65533 /= 65533 = False +65533 /= 65534 = True +65533 /= 65535 = True +65533 /= 0 = True +65533 /= 1 = True +65533 /= 2 = True +65533 /= 3 = True + +65534 /= 65533 = True +65534 /= 65534 = False +65534 /= 65535 = True +65534 /= 0 = True +65534 /= 1 = True +65534 /= 2 = True +65534 /= 3 = True + +65535 /= 65533 = True +65535 /= 65534 = True +65535 /= 65535 = False +65535 /= 0 = True +65535 /= 1 = True +65535 /= 2 = True +65535 /= 3 = True + +0 /= 65533 = True +0 /= 65534 = True +0 /= 65535 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 65533 = True +1 /= 65534 = True +1 /= 65535 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 65533 = True +2 /= 65534 = True +2 /= 65535 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 65533 = True +3 /= 65534 = True +3 /= 65535 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +65533 <= 65533 = True +65533 <= 65534 = True +65533 <= 65535 = True +65533 <= 0 = False +65533 <= 1 = False +65533 <= 2 = False +65533 <= 3 = False + +65534 <= 65533 = False +65534 <= 65534 = True +65534 <= 65535 = True +65534 <= 0 = False +65534 <= 1 = False +65534 <= 2 = False +65534 <= 3 = False + +65535 <= 65533 = False +65535 <= 65534 = False +65535 <= 65535 = True +65535 <= 0 = False +65535 <= 1 = False +65535 <= 2 = False +65535 <= 3 = False + +0 <= 65533 = True +0 <= 65534 = True +0 <= 65535 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 65533 = True +1 <= 65534 = True +1 <= 65535 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 65533 = True +2 <= 65534 = True +2 <= 65535 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 65533 = True +3 <= 65534 = True +3 <= 65535 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +65533 < 65533 = False +65533 < 65534 = True +65533 < 65535 = True +65533 < 0 = False +65533 < 1 = False +65533 < 2 = False +65533 < 3 = False + +65534 < 65533 = False +65534 < 65534 = False +65534 < 65535 = True +65534 < 0 = False +65534 < 1 = False +65534 < 2 = False +65534 < 3 = False + +65535 < 65533 = False +65535 < 65534 = False +65535 < 65535 = False +65535 < 0 = False +65535 < 1 = False +65535 < 2 = False +65535 < 3 = False + +0 < 65533 = True +0 < 65534 = True +0 < 65535 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 65533 = True +1 < 65534 = True +1 < 65535 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 65533 = True +2 < 65534 = True +2 < 65535 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 65533 = True +3 < 65534 = True +3 < 65535 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +65533 > 65533 = False +65533 > 65534 = False +65533 > 65535 = False +65533 > 0 = True +65533 > 1 = True +65533 > 2 = True +65533 > 3 = True + +65534 > 65533 = True +65534 > 65534 = False +65534 > 65535 = False +65534 > 0 = True +65534 > 1 = True +65534 > 2 = True +65534 > 3 = True + +65535 > 65533 = True +65535 > 65534 = True +65535 > 65535 = False +65535 > 0 = True +65535 > 1 = True +65535 > 2 = True +65535 > 3 = True + +0 > 65533 = False +0 > 65534 = False +0 > 65535 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 65533 = False +1 > 65534 = False +1 > 65535 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 65533 = False +2 > 65534 = False +2 > 65535 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 65533 = False +3 > 65534 = False +3 > 65535 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +65533 >= 65533 = True +65533 >= 65534 = False +65533 >= 65535 = False +65533 >= 0 = True +65533 >= 1 = True +65533 >= 2 = True +65533 >= 3 = True + +65534 >= 65533 = True +65534 >= 65534 = True +65534 >= 65535 = False +65534 >= 0 = True +65534 >= 1 = True +65534 >= 2 = True +65534 >= 3 = True + +65535 >= 65533 = True +65535 >= 65534 = True +65535 >= 65535 = True +65535 >= 0 = True +65535 >= 1 = True +65535 >= 2 = True +65535 >= 3 = True + +0 >= 65533 = False +0 >= 65534 = False +0 >= 65535 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 65533 = False +1 >= 65534 = False +1 >= 65535 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 65533 = False +2 >= 65534 = False +2 >= 65535 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 65533 = False +3 >= 65534 = False +3 >= 65535 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +65533 `compare` 65533 = EQ +65533 `compare` 65534 = LT +65533 `compare` 65535 = LT +65533 `compare` 0 = GT +65533 `compare` 1 = GT +65533 `compare` 2 = GT +65533 `compare` 3 = GT + +65534 `compare` 65533 = GT +65534 `compare` 65534 = EQ +65534 `compare` 65535 = LT +65534 `compare` 0 = GT +65534 `compare` 1 = GT +65534 `compare` 2 = GT +65534 `compare` 3 = GT + +65535 `compare` 65533 = GT +65535 `compare` 65534 = GT +65535 `compare` 65535 = EQ +65535 `compare` 0 = GT +65535 `compare` 1 = GT +65535 `compare` 2 = GT +65535 `compare` 3 = GT + +0 `compare` 65533 = LT +0 `compare` 65534 = LT +0 `compare` 65535 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 65533 = LT +1 `compare` 65534 = LT +1 `compare` 65535 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 65533 = LT +2 `compare` 65534 = LT +2 `compare` 65535 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 65533 = LT +3 `compare` 65534 = LT +3 `compare` 65535 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +65533 + 65533 = 65530 +65533 + 65534 = 65531 +65533 + 65535 = 65532 +65533 + 0 = 65533 +65533 + 1 = 65534 +65533 + 2 = 65535 +65533 + 3 = 0 + +65534 + 65533 = 65531 +65534 + 65534 = 65532 +65534 + 65535 = 65533 +65534 + 0 = 65534 +65534 + 1 = 65535 +65534 + 2 = 0 +65534 + 3 = 1 + +65535 + 65533 = 65532 +65535 + 65534 = 65533 +65535 + 65535 = 65534 +65535 + 0 = 65535 +65535 + 1 = 0 +65535 + 2 = 1 +65535 + 3 = 2 + +0 + 65533 = 65533 +0 + 65534 = 65534 +0 + 65535 = 65535 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 65533 = 65534 +1 + 65534 = 65535 +1 + 65535 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 65533 = 65535 +2 + 65534 = 0 +2 + 65535 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 65533 = 0 +3 + 65534 = 1 +3 + 65535 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +65533 - 65533 = 0 +65533 - 65534 = 65535 +65533 - 65535 = 65534 +65533 - 0 = 65533 +65533 - 1 = 65532 +65533 - 2 = 65531 +65533 - 3 = 65530 + +65534 - 65533 = 1 +65534 - 65534 = 0 +65534 - 65535 = 65535 +65534 - 0 = 65534 +65534 - 1 = 65533 +65534 - 2 = 65532 +65534 - 3 = 65531 + +65535 - 65533 = 2 +65535 - 65534 = 1 +65535 - 65535 = 0 +65535 - 0 = 65535 +65535 - 1 = 65534 +65535 - 2 = 65533 +65535 - 3 = 65532 + +0 - 65533 = 3 +0 - 65534 = 2 +0 - 65535 = 1 +0 - 0 = 0 +0 - 1 = 65535 +0 - 2 = 65534 +0 - 3 = 65533 + +1 - 65533 = 4 +1 - 65534 = 3 +1 - 65535 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 65535 +1 - 3 = 65534 + +2 - 65533 = 5 +2 - 65534 = 4 +2 - 65535 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 65535 + +3 - 65533 = 6 +3 - 65534 = 5 +3 - 65535 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +65533 * 65533 = 9 +65533 * 65534 = 6 +65533 * 65535 = 3 +65533 * 0 = 0 +65533 * 1 = 65533 +65533 * 2 = 65530 +65533 * 3 = 65527 + +65534 * 65533 = 6 +65534 * 65534 = 4 +65534 * 65535 = 2 +65534 * 0 = 0 +65534 * 1 = 65534 +65534 * 2 = 65532 +65534 * 3 = 65530 + +65535 * 65533 = 3 +65535 * 65534 = 2 +65535 * 65535 = 1 +65535 * 0 = 0 +65535 * 1 = 65535 +65535 * 2 = 65534 +65535 * 3 = 65533 + +0 * 65533 = 0 +0 * 65534 = 0 +0 * 65535 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 65533 = 65533 +1 * 65534 = 65534 +1 * 65535 = 65535 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 65533 = 65530 +2 * 65534 = 65532 +2 * 65535 = 65534 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 65533 = 65527 +3 * 65534 = 65530 +3 * 65535 = 65533 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 65533 = 3 +negate 65534 = 2 +negate 65535 = 1 +negate 0 = 0 +negate 1 = 65535 +negate 2 = 65534 +negate 3 = 65533 +# +testReal +toRational 65533 = 65533 % 1 +toRational 65534 = 65534 % 1 +toRational 65535 = 65535 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +65533 `divMod` 65533 = (1,0) +65533 `divMod` 65534 = (0,65533) +65533 `divMod` 65535 = (0,65533) +65533 `divMod` 0 = divide by zero +65533 `divMod` 1 = (65533,0) +65533 `divMod` 2 = (32766,1) +65533 `divMod` 3 = (21844,1) + +65534 `divMod` 65533 = (1,1) +65534 `divMod` 65534 = (1,0) +65534 `divMod` 65535 = (0,65534) +65534 `divMod` 0 = divide by zero +65534 `divMod` 1 = (65534,0) +65534 `divMod` 2 = (32767,0) +65534 `divMod` 3 = (21844,2) + +65535 `divMod` 65533 = (1,2) +65535 `divMod` 65534 = (1,1) +65535 `divMod` 65535 = (1,0) +65535 `divMod` 0 = divide by zero +65535 `divMod` 1 = (65535,0) +65535 `divMod` 2 = (32767,1) +65535 `divMod` 3 = (21845,0) + +0 `divMod` 65533 = (0,0) +0 `divMod` 65534 = (0,0) +0 `divMod` 65535 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 65533 = (0,1) +1 `divMod` 65534 = (0,1) +1 `divMod` 65535 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 65533 = (0,2) +2 `divMod` 65534 = (0,2) +2 `divMod` 65535 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 65533 = (0,3) +3 `divMod` 65534 = (0,3) +3 `divMod` 65535 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +65533 `div` 65533 = 1 +65533 `div` 65534 = 0 +65533 `div` 65535 = 0 +65533 `div` 0 = divide by zero +65533 `div` 1 = 65533 +65533 `div` 2 = 32766 +65533 `div` 3 = 21844 + +65534 `div` 65533 = 1 +65534 `div` 65534 = 1 +65534 `div` 65535 = 0 +65534 `div` 0 = divide by zero +65534 `div` 1 = 65534 +65534 `div` 2 = 32767 +65534 `div` 3 = 21844 + +65535 `div` 65533 = 1 +65535 `div` 65534 = 1 +65535 `div` 65535 = 1 +65535 `div` 0 = divide by zero +65535 `div` 1 = 65535 +65535 `div` 2 = 32767 +65535 `div` 3 = 21845 + +0 `div` 65533 = 0 +0 `div` 65534 = 0 +0 `div` 65535 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 65533 = 0 +1 `div` 65534 = 0 +1 `div` 65535 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 65533 = 0 +2 `div` 65534 = 0 +2 `div` 65535 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 65533 = 0 +3 `div` 65534 = 0 +3 `div` 65535 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +65533 `mod` 65533 = 0 +65533 `mod` 65534 = 65533 +65533 `mod` 65535 = 65533 +65533 `mod` 0 = divide by zero +65533 `mod` 1 = 0 +65533 `mod` 2 = 1 +65533 `mod` 3 = 1 + +65534 `mod` 65533 = 1 +65534 `mod` 65534 = 0 +65534 `mod` 65535 = 65534 +65534 `mod` 0 = divide by zero +65534 `mod` 1 = 0 +65534 `mod` 2 = 0 +65534 `mod` 3 = 2 + +65535 `mod` 65533 = 2 +65535 `mod` 65534 = 1 +65535 `mod` 65535 = 0 +65535 `mod` 0 = divide by zero +65535 `mod` 1 = 0 +65535 `mod` 2 = 1 +65535 `mod` 3 = 0 + +0 `mod` 65533 = 0 +0 `mod` 65534 = 0 +0 `mod` 65535 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 65533 = 1 +1 `mod` 65534 = 1 +1 `mod` 65535 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 65533 = 2 +2 `mod` 65534 = 2 +2 `mod` 65535 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 65533 = 3 +3 `mod` 65534 = 3 +3 `mod` 65535 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +65533 `quotRem` 65533 = (1,0) +65533 `quotRem` 65534 = (0,65533) +65533 `quotRem` 65535 = (0,65533) +65533 `quotRem` 0 = divide by zero +65533 `quotRem` 1 = (65533,0) +65533 `quotRem` 2 = (32766,1) +65533 `quotRem` 3 = (21844,1) + +65534 `quotRem` 65533 = (1,1) +65534 `quotRem` 65534 = (1,0) +65534 `quotRem` 65535 = (0,65534) +65534 `quotRem` 0 = divide by zero +65534 `quotRem` 1 = (65534,0) +65534 `quotRem` 2 = (32767,0) +65534 `quotRem` 3 = (21844,2) + +65535 `quotRem` 65533 = (1,2) +65535 `quotRem` 65534 = (1,1) +65535 `quotRem` 65535 = (1,0) +65535 `quotRem` 0 = divide by zero +65535 `quotRem` 1 = (65535,0) +65535 `quotRem` 2 = (32767,1) +65535 `quotRem` 3 = (21845,0) + +0 `quotRem` 65533 = (0,0) +0 `quotRem` 65534 = (0,0) +0 `quotRem` 65535 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 65533 = (0,1) +1 `quotRem` 65534 = (0,1) +1 `quotRem` 65535 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 65533 = (0,2) +2 `quotRem` 65534 = (0,2) +2 `quotRem` 65535 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 65533 = (0,3) +3 `quotRem` 65534 = (0,3) +3 `quotRem` 65535 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +65533 `quot` 65533 = 1 +65533 `quot` 65534 = 0 +65533 `quot` 65535 = 0 +65533 `quot` 0 = divide by zero +65533 `quot` 1 = 65533 +65533 `quot` 2 = 32766 +65533 `quot` 3 = 21844 + +65534 `quot` 65533 = 1 +65534 `quot` 65534 = 1 +65534 `quot` 65535 = 0 +65534 `quot` 0 = divide by zero +65534 `quot` 1 = 65534 +65534 `quot` 2 = 32767 +65534 `quot` 3 = 21844 + +65535 `quot` 65533 = 1 +65535 `quot` 65534 = 1 +65535 `quot` 65535 = 1 +65535 `quot` 0 = divide by zero +65535 `quot` 1 = 65535 +65535 `quot` 2 = 32767 +65535 `quot` 3 = 21845 + +0 `quot` 65533 = 0 +0 `quot` 65534 = 0 +0 `quot` 65535 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 65533 = 0 +1 `quot` 65534 = 0 +1 `quot` 65535 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 65533 = 0 +2 `quot` 65534 = 0 +2 `quot` 65535 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 65533 = 0 +3 `quot` 65534 = 0 +3 `quot` 65535 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +65533 `rem` 65533 = 0 +65533 `rem` 65534 = 65533 +65533 `rem` 65535 = 65533 +65533 `rem` 0 = divide by zero +65533 `rem` 1 = 0 +65533 `rem` 2 = 1 +65533 `rem` 3 = 1 + +65534 `rem` 65533 = 1 +65534 `rem` 65534 = 0 +65534 `rem` 65535 = 65534 +65534 `rem` 0 = divide by zero +65534 `rem` 1 = 0 +65534 `rem` 2 = 0 +65534 `rem` 3 = 2 + +65535 `rem` 65533 = 2 +65535 `rem` 65534 = 1 +65535 `rem` 65535 = 0 +65535 `rem` 0 = divide by zero +65535 `rem` 1 = 0 +65535 `rem` 2 = 1 +65535 `rem` 3 = 0 + +0 `rem` 65533 = 0 +0 `rem` 65534 = 0 +0 `rem` 65535 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 65533 = 1 +1 `rem` 65534 = 1 +1 `rem` 65535 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 65533 = 2 +2 `rem` 65534 = 2 +2 `rem` 65535 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 65533 = 3 +3 `rem` 65534 = 3 +3 `rem` 65535 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,65535] +Int : [0,0,65535] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,65535] +Int64 : [0,0,65535] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,65535] +Word64 : [0,0,65535] +testBits +65533 .&. 65533 = 65533 +65533 .&. 65534 = 65532 +65533 .&. 65535 = 65533 +65533 .&. 0 = 0 +65533 .&. 1 = 1 +65533 .&. 2 = 0 +65533 .&. 3 = 1 + +65534 .&. 65533 = 65532 +65534 .&. 65534 = 65534 +65534 .&. 65535 = 65534 +65534 .&. 0 = 0 +65534 .&. 1 = 0 +65534 .&. 2 = 2 +65534 .&. 3 = 2 + +65535 .&. 65533 = 65533 +65535 .&. 65534 = 65534 +65535 .&. 65535 = 65535 +65535 .&. 0 = 0 +65535 .&. 1 = 1 +65535 .&. 2 = 2 +65535 .&. 3 = 3 + +0 .&. 65533 = 0 +0 .&. 65534 = 0 +0 .&. 65535 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 65533 = 1 +1 .&. 65534 = 0 +1 .&. 65535 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 65533 = 0 +2 .&. 65534 = 2 +2 .&. 65535 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 65533 = 1 +3 .&. 65534 = 2 +3 .&. 65535 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +65533 .|. 65533 = 65533 +65533 .|. 65534 = 65535 +65533 .|. 65535 = 65535 +65533 .|. 0 = 65533 +65533 .|. 1 = 65533 +65533 .|. 2 = 65535 +65533 .|. 3 = 65535 + +65534 .|. 65533 = 65535 +65534 .|. 65534 = 65534 +65534 .|. 65535 = 65535 +65534 .|. 0 = 65534 +65534 .|. 1 = 65535 +65534 .|. 2 = 65534 +65534 .|. 3 = 65535 + +65535 .|. 65533 = 65535 +65535 .|. 65534 = 65535 +65535 .|. 65535 = 65535 +65535 .|. 0 = 65535 +65535 .|. 1 = 65535 +65535 .|. 2 = 65535 +65535 .|. 3 = 65535 + +0 .|. 65533 = 65533 +0 .|. 65534 = 65534 +0 .|. 65535 = 65535 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 65533 = 65533 +1 .|. 65534 = 65535 +1 .|. 65535 = 65535 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 65533 = 65535 +2 .|. 65534 = 65534 +2 .|. 65535 = 65535 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 65533 = 65535 +3 .|. 65534 = 65535 +3 .|. 65535 = 65535 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +65533 `xor` 65533 = 0 +65533 `xor` 65534 = 3 +65533 `xor` 65535 = 2 +65533 `xor` 0 = 65533 +65533 `xor` 1 = 65532 +65533 `xor` 2 = 65535 +65533 `xor` 3 = 65534 + +65534 `xor` 65533 = 3 +65534 `xor` 65534 = 0 +65534 `xor` 65535 = 1 +65534 `xor` 0 = 65534 +65534 `xor` 1 = 65535 +65534 `xor` 2 = 65532 +65534 `xor` 3 = 65533 + +65535 `xor` 65533 = 2 +65535 `xor` 65534 = 1 +65535 `xor` 65535 = 0 +65535 `xor` 0 = 65535 +65535 `xor` 1 = 65534 +65535 `xor` 2 = 65533 +65535 `xor` 3 = 65532 + +0 `xor` 65533 = 65533 +0 `xor` 65534 = 65534 +0 `xor` 65535 = 65535 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 65533 = 65532 +1 `xor` 65534 = 65535 +1 `xor` 65535 = 65534 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 65533 = 65535 +2 `xor` 65534 = 65532 +2 `xor` 65535 = 65533 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 65533 = 65534 +3 `xor` 65534 = 65533 +3 `xor` 65535 = 65532 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 65533 = 2 +complement 65534 = 1 +complement 65535 = 0 +complement 0 = 65535 +complement 1 = 65534 +complement 2 = 65533 +complement 3 = 65532 +# +65533 `shiftL` 0 = 65533 +65533 `shiftL` 1 = 65530 +65533 `shiftL` 2 = 65524 +65533 `shiftL` 3 = 65512 +65533 `shiftL` 32 = 0 +65533 `shiftL` 64 = 0 + +65534 `shiftL` 0 = 65534 +65534 `shiftL` 1 = 65532 +65534 `shiftL` 2 = 65528 +65534 `shiftL` 3 = 65520 +65534 `shiftL` 32 = 0 +65534 `shiftL` 64 = 0 + +65535 `shiftL` 0 = 65535 +65535 `shiftL` 1 = 65534 +65535 `shiftL` 2 = 65532 +65535 `shiftL` 3 = 65528 +65535 `shiftL` 32 = 0 +65535 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +65533 `shiftR` 0 = 65533 +65533 `shiftR` 1 = 32766 +65533 `shiftR` 2 = 16383 +65533 `shiftR` 3 = 8191 +65533 `shiftR` 32 = 0 +65533 `shiftR` 64 = 0 + +65534 `shiftR` 0 = 65534 +65534 `shiftR` 1 = 32767 +65534 `shiftR` 2 = 16383 +65534 `shiftR` 3 = 8191 +65534 `shiftR` 32 = 0 +65534 `shiftR` 64 = 0 + +65535 `shiftR` 0 = 65535 +65535 `shiftR` 1 = 32767 +65535 `shiftR` 2 = 16383 +65535 `shiftR` 3 = 8191 +65535 `shiftR` 32 = 0 +65535 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +65533 `rotate` -3 = 49151 +65533 `rotate` -2 = 32767 +65533 `rotate` -1 = 65534 +65533 `rotate` 0 = 65533 +65533 `rotate` 1 = 65531 +65533 `rotate` 2 = 65527 +65533 `rotate` 3 = 65519 + +65534 `rotate` -3 = 57343 +65534 `rotate` -2 = 49151 +65534 `rotate` -1 = 32767 +65534 `rotate` 0 = 65534 +65534 `rotate` 1 = 65533 +65534 `rotate` 2 = 65531 +65534 `rotate` 3 = 65527 + +65535 `rotate` -3 = 65535 +65535 `rotate` -2 = 65535 +65535 `rotate` -1 = 65535 +65535 `rotate` 0 = 65535 +65535 `rotate` 1 = 65535 +65535 `rotate` 2 = 65535 +65535 `rotate` 3 = 65535 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 8192 +1 `rotate` -2 = 16384 +1 `rotate` -1 = 32768 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 16384 +2 `rotate` -2 = 32768 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 24576 +3 `rotate` -2 = 49152 +3 `rotate` -1 = 32769 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +65533 `setBit` 0 = 65533 +65533 `setBit` 1 = 65535 +65533 `setBit` 2 = 65533 +65533 `setBit` 3 = 65533 +65533 `setBit` 32 = 65533 +65533 `setBit` 64 = 65533 + +65534 `setBit` 0 = 65535 +65534 `setBit` 1 = 65534 +65534 `setBit` 2 = 65534 +65534 `setBit` 3 = 65534 +65534 `setBit` 32 = 65534 +65534 `setBit` 64 = 65534 + +65535 `setBit` 0 = 65535 +65535 `setBit` 1 = 65535 +65535 `setBit` 2 = 65535 +65535 `setBit` 3 = 65535 +65535 `setBit` 32 = 65535 +65535 `setBit` 64 = 65535 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +65533 `clearBit` 0 = 65532 +65533 `clearBit` 1 = 65533 +65533 `clearBit` 2 = 65529 +65533 `clearBit` 3 = 65525 +65533 `clearBit` 32 = 65533 +65533 `clearBit` 64 = 65533 + +65534 `clearBit` 0 = 65534 +65534 `clearBit` 1 = 65532 +65534 `clearBit` 2 = 65530 +65534 `clearBit` 3 = 65526 +65534 `clearBit` 32 = 65534 +65534 `clearBit` 64 = 65534 + +65535 `clearBit` 0 = 65534 +65535 `clearBit` 1 = 65533 +65535 `clearBit` 2 = 65531 +65535 `clearBit` 3 = 65527 +65535 `clearBit` 32 = 65535 +65535 `clearBit` 64 = 65535 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +65533 `complementBit` 0 = 65532 +65533 `complementBit` 1 = 65535 +65533 `complementBit` 2 = 65529 +65533 `complementBit` 3 = 65525 +65533 `complementBit` 32 = 65533 +65533 `complementBit` 64 = 65533 + +65534 `complementBit` 0 = 65535 +65534 `complementBit` 1 = 65532 +65534 `complementBit` 2 = 65530 +65534 `complementBit` 3 = 65526 +65534 `complementBit` 32 = 65534 +65534 `complementBit` 64 = 65534 + +65535 `complementBit` 0 = 65534 +65535 `complementBit` 1 = 65533 +65535 `complementBit` 2 = 65531 +65535 `complementBit` 3 = 65527 +65535 `complementBit` 32 = 65535 +65535 `complementBit` 64 = 65535 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +65533 `testBit` 0 = True +65533 `testBit` 1 = False +65533 `testBit` 2 = True +65533 `testBit` 3 = True +65533 `testBit` 32 = False +65533 `testBit` 64 = False + +65534 `testBit` 0 = False +65534 `testBit` 1 = True +65534 `testBit` 2 = True +65534 `testBit` 3 = True +65534 `testBit` 32 = False +65534 `testBit` 64 = False + +65535 `testBit` 0 = True +65535 `testBit` 1 = True +65535 `testBit` 2 = True +65535 `testBit` 3 = True +65535 `testBit` 32 = False +65535 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 65533 = 16 +bitSize 65534 = 16 +bitSize 65535 = 16 +bitSize 0 = 16 +bitSize 1 = 16 +bitSize 2 = 16 +bitSize 3 = 16 +# +isSigned 65533 = False +isSigned 65534 = False +isSigned 65535 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word32 +-------------------------------- +testBounded +(4294967295,0,1) +(4294967294,4294967295,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[4294967293,4294967294,4294967295,0,1,2,3] +[4294967293,4294967294,4294967295,0,1,2,3] +testEq +4294967293 == 4294967293 = True +4294967293 == 4294967294 = False +4294967293 == 4294967295 = False +4294967293 == 0 = False +4294967293 == 1 = False +4294967293 == 2 = False +4294967293 == 3 = False + +4294967294 == 4294967293 = False +4294967294 == 4294967294 = True +4294967294 == 4294967295 = False +4294967294 == 0 = False +4294967294 == 1 = False +4294967294 == 2 = False +4294967294 == 3 = False + +4294967295 == 4294967293 = False +4294967295 == 4294967294 = False +4294967295 == 4294967295 = True +4294967295 == 0 = False +4294967295 == 1 = False +4294967295 == 2 = False +4294967295 == 3 = False + +0 == 4294967293 = False +0 == 4294967294 = False +0 == 4294967295 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 4294967293 = False +1 == 4294967294 = False +1 == 4294967295 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 4294967293 = False +2 == 4294967294 = False +2 == 4294967295 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 4294967293 = False +3 == 4294967294 = False +3 == 4294967295 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +4294967293 /= 4294967293 = False +4294967293 /= 4294967294 = True +4294967293 /= 4294967295 = True +4294967293 /= 0 = True +4294967293 /= 1 = True +4294967293 /= 2 = True +4294967293 /= 3 = True + +4294967294 /= 4294967293 = True +4294967294 /= 4294967294 = False +4294967294 /= 4294967295 = True +4294967294 /= 0 = True +4294967294 /= 1 = True +4294967294 /= 2 = True +4294967294 /= 3 = True + +4294967295 /= 4294967293 = True +4294967295 /= 4294967294 = True +4294967295 /= 4294967295 = False +4294967295 /= 0 = True +4294967295 /= 1 = True +4294967295 /= 2 = True +4294967295 /= 3 = True + +0 /= 4294967293 = True +0 /= 4294967294 = True +0 /= 4294967295 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 4294967293 = True +1 /= 4294967294 = True +1 /= 4294967295 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 4294967293 = True +2 /= 4294967294 = True +2 /= 4294967295 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 4294967293 = True +3 /= 4294967294 = True +3 /= 4294967295 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +4294967293 <= 4294967293 = True +4294967293 <= 4294967294 = True +4294967293 <= 4294967295 = True +4294967293 <= 0 = False +4294967293 <= 1 = False +4294967293 <= 2 = False +4294967293 <= 3 = False + +4294967294 <= 4294967293 = False +4294967294 <= 4294967294 = True +4294967294 <= 4294967295 = True +4294967294 <= 0 = False +4294967294 <= 1 = False +4294967294 <= 2 = False +4294967294 <= 3 = False + +4294967295 <= 4294967293 = False +4294967295 <= 4294967294 = False +4294967295 <= 4294967295 = True +4294967295 <= 0 = False +4294967295 <= 1 = False +4294967295 <= 2 = False +4294967295 <= 3 = False + +0 <= 4294967293 = True +0 <= 4294967294 = True +0 <= 4294967295 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 4294967293 = True +1 <= 4294967294 = True +1 <= 4294967295 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 4294967293 = True +2 <= 4294967294 = True +2 <= 4294967295 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 4294967293 = True +3 <= 4294967294 = True +3 <= 4294967295 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +4294967293 < 4294967293 = False +4294967293 < 4294967294 = True +4294967293 < 4294967295 = True +4294967293 < 0 = False +4294967293 < 1 = False +4294967293 < 2 = False +4294967293 < 3 = False + +4294967294 < 4294967293 = False +4294967294 < 4294967294 = False +4294967294 < 4294967295 = True +4294967294 < 0 = False +4294967294 < 1 = False +4294967294 < 2 = False +4294967294 < 3 = False + +4294967295 < 4294967293 = False +4294967295 < 4294967294 = False +4294967295 < 4294967295 = False +4294967295 < 0 = False +4294967295 < 1 = False +4294967295 < 2 = False +4294967295 < 3 = False + +0 < 4294967293 = True +0 < 4294967294 = True +0 < 4294967295 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 4294967293 = True +1 < 4294967294 = True +1 < 4294967295 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 4294967293 = True +2 < 4294967294 = True +2 < 4294967295 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 4294967293 = True +3 < 4294967294 = True +3 < 4294967295 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +4294967293 > 4294967293 = False +4294967293 > 4294967294 = False +4294967293 > 4294967295 = False +4294967293 > 0 = True +4294967293 > 1 = True +4294967293 > 2 = True +4294967293 > 3 = True + +4294967294 > 4294967293 = True +4294967294 > 4294967294 = False +4294967294 > 4294967295 = False +4294967294 > 0 = True +4294967294 > 1 = True +4294967294 > 2 = True +4294967294 > 3 = True + +4294967295 > 4294967293 = True +4294967295 > 4294967294 = True +4294967295 > 4294967295 = False +4294967295 > 0 = True +4294967295 > 1 = True +4294967295 > 2 = True +4294967295 > 3 = True + +0 > 4294967293 = False +0 > 4294967294 = False +0 > 4294967295 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 4294967293 = False +1 > 4294967294 = False +1 > 4294967295 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 4294967293 = False +2 > 4294967294 = False +2 > 4294967295 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 4294967293 = False +3 > 4294967294 = False +3 > 4294967295 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +4294967293 >= 4294967293 = True +4294967293 >= 4294967294 = False +4294967293 >= 4294967295 = False +4294967293 >= 0 = True +4294967293 >= 1 = True +4294967293 >= 2 = True +4294967293 >= 3 = True + +4294967294 >= 4294967293 = True +4294967294 >= 4294967294 = True +4294967294 >= 4294967295 = False +4294967294 >= 0 = True +4294967294 >= 1 = True +4294967294 >= 2 = True +4294967294 >= 3 = True + +4294967295 >= 4294967293 = True +4294967295 >= 4294967294 = True +4294967295 >= 4294967295 = True +4294967295 >= 0 = True +4294967295 >= 1 = True +4294967295 >= 2 = True +4294967295 >= 3 = True + +0 >= 4294967293 = False +0 >= 4294967294 = False +0 >= 4294967295 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 4294967293 = False +1 >= 4294967294 = False +1 >= 4294967295 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 4294967293 = False +2 >= 4294967294 = False +2 >= 4294967295 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 4294967293 = False +3 >= 4294967294 = False +3 >= 4294967295 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +4294967293 `compare` 4294967293 = EQ +4294967293 `compare` 4294967294 = LT +4294967293 `compare` 4294967295 = LT +4294967293 `compare` 0 = GT +4294967293 `compare` 1 = GT +4294967293 `compare` 2 = GT +4294967293 `compare` 3 = GT + +4294967294 `compare` 4294967293 = GT +4294967294 `compare` 4294967294 = EQ +4294967294 `compare` 4294967295 = LT +4294967294 `compare` 0 = GT +4294967294 `compare` 1 = GT +4294967294 `compare` 2 = GT +4294967294 `compare` 3 = GT + +4294967295 `compare` 4294967293 = GT +4294967295 `compare` 4294967294 = GT +4294967295 `compare` 4294967295 = EQ +4294967295 `compare` 0 = GT +4294967295 `compare` 1 = GT +4294967295 `compare` 2 = GT +4294967295 `compare` 3 = GT + +0 `compare` 4294967293 = LT +0 `compare` 4294967294 = LT +0 `compare` 4294967295 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 4294967293 = LT +1 `compare` 4294967294 = LT +1 `compare` 4294967295 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 4294967293 = LT +2 `compare` 4294967294 = LT +2 `compare` 4294967295 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 4294967293 = LT +3 `compare` 4294967294 = LT +3 `compare` 4294967295 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +4294967293 + 4294967293 = 4294967290 +4294967293 + 4294967294 = 4294967291 +4294967293 + 4294967295 = 4294967292 +4294967293 + 0 = 4294967293 +4294967293 + 1 = 4294967294 +4294967293 + 2 = 4294967295 +4294967293 + 3 = 0 + +4294967294 + 4294967293 = 4294967291 +4294967294 + 4294967294 = 4294967292 +4294967294 + 4294967295 = 4294967293 +4294967294 + 0 = 4294967294 +4294967294 + 1 = 4294967295 +4294967294 + 2 = 0 +4294967294 + 3 = 1 + +4294967295 + 4294967293 = 4294967292 +4294967295 + 4294967294 = 4294967293 +4294967295 + 4294967295 = 4294967294 +4294967295 + 0 = 4294967295 +4294967295 + 1 = 0 +4294967295 + 2 = 1 +4294967295 + 3 = 2 + +0 + 4294967293 = 4294967293 +0 + 4294967294 = 4294967294 +0 + 4294967295 = 4294967295 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 4294967293 = 4294967294 +1 + 4294967294 = 4294967295 +1 + 4294967295 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 4294967293 = 4294967295 +2 + 4294967294 = 0 +2 + 4294967295 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 4294967293 = 0 +3 + 4294967294 = 1 +3 + 4294967295 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +4294967293 - 4294967293 = 0 +4294967293 - 4294967294 = 4294967295 +4294967293 - 4294967295 = 4294967294 +4294967293 - 0 = 4294967293 +4294967293 - 1 = 4294967292 +4294967293 - 2 = 4294967291 +4294967293 - 3 = 4294967290 + +4294967294 - 4294967293 = 1 +4294967294 - 4294967294 = 0 +4294967294 - 4294967295 = 4294967295 +4294967294 - 0 = 4294967294 +4294967294 - 1 = 4294967293 +4294967294 - 2 = 4294967292 +4294967294 - 3 = 4294967291 + +4294967295 - 4294967293 = 2 +4294967295 - 4294967294 = 1 +4294967295 - 4294967295 = 0 +4294967295 - 0 = 4294967295 +4294967295 - 1 = 4294967294 +4294967295 - 2 = 4294967293 +4294967295 - 3 = 4294967292 + +0 - 4294967293 = 3 +0 - 4294967294 = 2 +0 - 4294967295 = 1 +0 - 0 = 0 +0 - 1 = 4294967295 +0 - 2 = 4294967294 +0 - 3 = 4294967293 + +1 - 4294967293 = 4 +1 - 4294967294 = 3 +1 - 4294967295 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 4294967295 +1 - 3 = 4294967294 + +2 - 4294967293 = 5 +2 - 4294967294 = 4 +2 - 4294967295 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 4294967295 + +3 - 4294967293 = 6 +3 - 4294967294 = 5 +3 - 4294967295 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +4294967293 * 4294967293 = 9 +4294967293 * 4294967294 = 6 +4294967293 * 4294967295 = 3 +4294967293 * 0 = 0 +4294967293 * 1 = 4294967293 +4294967293 * 2 = 4294967290 +4294967293 * 3 = 4294967287 + +4294967294 * 4294967293 = 6 +4294967294 * 4294967294 = 4 +4294967294 * 4294967295 = 2 +4294967294 * 0 = 0 +4294967294 * 1 = 4294967294 +4294967294 * 2 = 4294967292 +4294967294 * 3 = 4294967290 + +4294967295 * 4294967293 = 3 +4294967295 * 4294967294 = 2 +4294967295 * 4294967295 = 1 +4294967295 * 0 = 0 +4294967295 * 1 = 4294967295 +4294967295 * 2 = 4294967294 +4294967295 * 3 = 4294967293 + +0 * 4294967293 = 0 +0 * 4294967294 = 0 +0 * 4294967295 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 4294967293 = 4294967293 +1 * 4294967294 = 4294967294 +1 * 4294967295 = 4294967295 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 4294967293 = 4294967290 +2 * 4294967294 = 4294967292 +2 * 4294967295 = 4294967294 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 4294967293 = 4294967287 +3 * 4294967294 = 4294967290 +3 * 4294967295 = 4294967293 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 4294967293 = 3 +negate 4294967294 = 2 +negate 4294967295 = 1 +negate 0 = 0 +negate 1 = 4294967295 +negate 2 = 4294967294 +negate 3 = 4294967293 +# +testReal +toRational 4294967293 = 4294967293 % 1 +toRational 4294967294 = 4294967294 % 1 +toRational 4294967295 = 4294967295 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +4294967293 `divMod` 4294967293 = (1,0) +4294967293 `divMod` 4294967294 = (0,4294967293) +4294967293 `divMod` 4294967295 = (0,4294967293) +4294967293 `divMod` 0 = divide by zero +4294967293 `divMod` 1 = (4294967293,0) +4294967293 `divMod` 2 = (2147483646,1) +4294967293 `divMod` 3 = (1431655764,1) + +4294967294 `divMod` 4294967293 = (1,1) +4294967294 `divMod` 4294967294 = (1,0) +4294967294 `divMod` 4294967295 = (0,4294967294) +4294967294 `divMod` 0 = divide by zero +4294967294 `divMod` 1 = (4294967294,0) +4294967294 `divMod` 2 = (2147483647,0) +4294967294 `divMod` 3 = (1431655764,2) + +4294967295 `divMod` 4294967293 = (1,2) +4294967295 `divMod` 4294967294 = (1,1) +4294967295 `divMod` 4294967295 = (1,0) +4294967295 `divMod` 0 = divide by zero +4294967295 `divMod` 1 = (4294967295,0) +4294967295 `divMod` 2 = (2147483647,1) +4294967295 `divMod` 3 = (1431655765,0) + +0 `divMod` 4294967293 = (0,0) +0 `divMod` 4294967294 = (0,0) +0 `divMod` 4294967295 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 4294967293 = (0,1) +1 `divMod` 4294967294 = (0,1) +1 `divMod` 4294967295 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 4294967293 = (0,2) +2 `divMod` 4294967294 = (0,2) +2 `divMod` 4294967295 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 4294967293 = (0,3) +3 `divMod` 4294967294 = (0,3) +3 `divMod` 4294967295 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +4294967293 `div` 4294967293 = 1 +4294967293 `div` 4294967294 = 0 +4294967293 `div` 4294967295 = 0 +4294967293 `div` 0 = divide by zero +4294967293 `div` 1 = 4294967293 +4294967293 `div` 2 = 2147483646 +4294967293 `div` 3 = 1431655764 + +4294967294 `div` 4294967293 = 1 +4294967294 `div` 4294967294 = 1 +4294967294 `div` 4294967295 = 0 +4294967294 `div` 0 = divide by zero +4294967294 `div` 1 = 4294967294 +4294967294 `div` 2 = 2147483647 +4294967294 `div` 3 = 1431655764 + +4294967295 `div` 4294967293 = 1 +4294967295 `div` 4294967294 = 1 +4294967295 `div` 4294967295 = 1 +4294967295 `div` 0 = divide by zero +4294967295 `div` 1 = 4294967295 +4294967295 `div` 2 = 2147483647 +4294967295 `div` 3 = 1431655765 + +0 `div` 4294967293 = 0 +0 `div` 4294967294 = 0 +0 `div` 4294967295 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 4294967293 = 0 +1 `div` 4294967294 = 0 +1 `div` 4294967295 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 4294967293 = 0 +2 `div` 4294967294 = 0 +2 `div` 4294967295 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 4294967293 = 0 +3 `div` 4294967294 = 0 +3 `div` 4294967295 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +4294967293 `mod` 4294967293 = 0 +4294967293 `mod` 4294967294 = 4294967293 +4294967293 `mod` 4294967295 = 4294967293 +4294967293 `mod` 0 = divide by zero +4294967293 `mod` 1 = 0 +4294967293 `mod` 2 = 1 +4294967293 `mod` 3 = 1 + +4294967294 `mod` 4294967293 = 1 +4294967294 `mod` 4294967294 = 0 +4294967294 `mod` 4294967295 = 4294967294 +4294967294 `mod` 0 = divide by zero +4294967294 `mod` 1 = 0 +4294967294 `mod` 2 = 0 +4294967294 `mod` 3 = 2 + +4294967295 `mod` 4294967293 = 2 +4294967295 `mod` 4294967294 = 1 +4294967295 `mod` 4294967295 = 0 +4294967295 `mod` 0 = divide by zero +4294967295 `mod` 1 = 0 +4294967295 `mod` 2 = 1 +4294967295 `mod` 3 = 0 + +0 `mod` 4294967293 = 0 +0 `mod` 4294967294 = 0 +0 `mod` 4294967295 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 4294967293 = 1 +1 `mod` 4294967294 = 1 +1 `mod` 4294967295 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 4294967293 = 2 +2 `mod` 4294967294 = 2 +2 `mod` 4294967295 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 4294967293 = 3 +3 `mod` 4294967294 = 3 +3 `mod` 4294967295 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +4294967293 `quotRem` 4294967293 = (1,0) +4294967293 `quotRem` 4294967294 = (0,4294967293) +4294967293 `quotRem` 4294967295 = (0,4294967293) +4294967293 `quotRem` 0 = divide by zero +4294967293 `quotRem` 1 = (4294967293,0) +4294967293 `quotRem` 2 = (2147483646,1) +4294967293 `quotRem` 3 = (1431655764,1) + +4294967294 `quotRem` 4294967293 = (1,1) +4294967294 `quotRem` 4294967294 = (1,0) +4294967294 `quotRem` 4294967295 = (0,4294967294) +4294967294 `quotRem` 0 = divide by zero +4294967294 `quotRem` 1 = (4294967294,0) +4294967294 `quotRem` 2 = (2147483647,0) +4294967294 `quotRem` 3 = (1431655764,2) + +4294967295 `quotRem` 4294967293 = (1,2) +4294967295 `quotRem` 4294967294 = (1,1) +4294967295 `quotRem` 4294967295 = (1,0) +4294967295 `quotRem` 0 = divide by zero +4294967295 `quotRem` 1 = (4294967295,0) +4294967295 `quotRem` 2 = (2147483647,1) +4294967295 `quotRem` 3 = (1431655765,0) + +0 `quotRem` 4294967293 = (0,0) +0 `quotRem` 4294967294 = (0,0) +0 `quotRem` 4294967295 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 4294967293 = (0,1) +1 `quotRem` 4294967294 = (0,1) +1 `quotRem` 4294967295 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 4294967293 = (0,2) +2 `quotRem` 4294967294 = (0,2) +2 `quotRem` 4294967295 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 4294967293 = (0,3) +3 `quotRem` 4294967294 = (0,3) +3 `quotRem` 4294967295 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +4294967293 `quot` 4294967293 = 1 +4294967293 `quot` 4294967294 = 0 +4294967293 `quot` 4294967295 = 0 +4294967293 `quot` 0 = divide by zero +4294967293 `quot` 1 = 4294967293 +4294967293 `quot` 2 = 2147483646 +4294967293 `quot` 3 = 1431655764 + +4294967294 `quot` 4294967293 = 1 +4294967294 `quot` 4294967294 = 1 +4294967294 `quot` 4294967295 = 0 +4294967294 `quot` 0 = divide by zero +4294967294 `quot` 1 = 4294967294 +4294967294 `quot` 2 = 2147483647 +4294967294 `quot` 3 = 1431655764 + +4294967295 `quot` 4294967293 = 1 +4294967295 `quot` 4294967294 = 1 +4294967295 `quot` 4294967295 = 1 +4294967295 `quot` 0 = divide by zero +4294967295 `quot` 1 = 4294967295 +4294967295 `quot` 2 = 2147483647 +4294967295 `quot` 3 = 1431655765 + +0 `quot` 4294967293 = 0 +0 `quot` 4294967294 = 0 +0 `quot` 4294967295 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 4294967293 = 0 +1 `quot` 4294967294 = 0 +1 `quot` 4294967295 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 4294967293 = 0 +2 `quot` 4294967294 = 0 +2 `quot` 4294967295 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 4294967293 = 0 +3 `quot` 4294967294 = 0 +3 `quot` 4294967295 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +4294967293 `rem` 4294967293 = 0 +4294967293 `rem` 4294967294 = 4294967293 +4294967293 `rem` 4294967295 = 4294967293 +4294967293 `rem` 0 = divide by zero +4294967293 `rem` 1 = 0 +4294967293 `rem` 2 = 1 +4294967293 `rem` 3 = 1 + +4294967294 `rem` 4294967293 = 1 +4294967294 `rem` 4294967294 = 0 +4294967294 `rem` 4294967295 = 4294967294 +4294967294 `rem` 0 = divide by zero +4294967294 `rem` 1 = 0 +4294967294 `rem` 2 = 0 +4294967294 `rem` 3 = 2 + +4294967295 `rem` 4294967293 = 2 +4294967295 `rem` 4294967294 = 1 +4294967295 `rem` 4294967295 = 0 +4294967295 `rem` 0 = divide by zero +4294967295 `rem` 1 = 0 +4294967295 `rem` 2 = 1 +4294967295 `rem` 3 = 0 + +0 `rem` 4294967293 = 0 +0 `rem` 4294967294 = 0 +0 `rem` 4294967295 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 4294967293 = 1 +1 `rem` 4294967294 = 1 +1 `rem` 4294967295 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 4294967293 = 2 +2 `rem` 4294967294 = 2 +2 `rem` 4294967295 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 4294967293 = 3 +3 `rem` 4294967294 = 3 +3 `rem` 4294967295 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,4294967295] +Int : [0,0,4294967295] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [0,0,4294967295] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [0,0,4294967295] +testBits +4294967293 .&. 4294967293 = 4294967293 +4294967293 .&. 4294967294 = 4294967292 +4294967293 .&. 4294967295 = 4294967293 +4294967293 .&. 0 = 0 +4294967293 .&. 1 = 1 +4294967293 .&. 2 = 0 +4294967293 .&. 3 = 1 + +4294967294 .&. 4294967293 = 4294967292 +4294967294 .&. 4294967294 = 4294967294 +4294967294 .&. 4294967295 = 4294967294 +4294967294 .&. 0 = 0 +4294967294 .&. 1 = 0 +4294967294 .&. 2 = 2 +4294967294 .&. 3 = 2 + +4294967295 .&. 4294967293 = 4294967293 +4294967295 .&. 4294967294 = 4294967294 +4294967295 .&. 4294967295 = 4294967295 +4294967295 .&. 0 = 0 +4294967295 .&. 1 = 1 +4294967295 .&. 2 = 2 +4294967295 .&. 3 = 3 + +0 .&. 4294967293 = 0 +0 .&. 4294967294 = 0 +0 .&. 4294967295 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 4294967293 = 1 +1 .&. 4294967294 = 0 +1 .&. 4294967295 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 4294967293 = 0 +2 .&. 4294967294 = 2 +2 .&. 4294967295 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 4294967293 = 1 +3 .&. 4294967294 = 2 +3 .&. 4294967295 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +4294967293 .|. 4294967293 = 4294967293 +4294967293 .|. 4294967294 = 4294967295 +4294967293 .|. 4294967295 = 4294967295 +4294967293 .|. 0 = 4294967293 +4294967293 .|. 1 = 4294967293 +4294967293 .|. 2 = 4294967295 +4294967293 .|. 3 = 4294967295 + +4294967294 .|. 4294967293 = 4294967295 +4294967294 .|. 4294967294 = 4294967294 +4294967294 .|. 4294967295 = 4294967295 +4294967294 .|. 0 = 4294967294 +4294967294 .|. 1 = 4294967295 +4294967294 .|. 2 = 4294967294 +4294967294 .|. 3 = 4294967295 + +4294967295 .|. 4294967293 = 4294967295 +4294967295 .|. 4294967294 = 4294967295 +4294967295 .|. 4294967295 = 4294967295 +4294967295 .|. 0 = 4294967295 +4294967295 .|. 1 = 4294967295 +4294967295 .|. 2 = 4294967295 +4294967295 .|. 3 = 4294967295 + +0 .|. 4294967293 = 4294967293 +0 .|. 4294967294 = 4294967294 +0 .|. 4294967295 = 4294967295 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 4294967293 = 4294967293 +1 .|. 4294967294 = 4294967295 +1 .|. 4294967295 = 4294967295 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 4294967293 = 4294967295 +2 .|. 4294967294 = 4294967294 +2 .|. 4294967295 = 4294967295 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 4294967293 = 4294967295 +3 .|. 4294967294 = 4294967295 +3 .|. 4294967295 = 4294967295 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +4294967293 `xor` 4294967293 = 0 +4294967293 `xor` 4294967294 = 3 +4294967293 `xor` 4294967295 = 2 +4294967293 `xor` 0 = 4294967293 +4294967293 `xor` 1 = 4294967292 +4294967293 `xor` 2 = 4294967295 +4294967293 `xor` 3 = 4294967294 + +4294967294 `xor` 4294967293 = 3 +4294967294 `xor` 4294967294 = 0 +4294967294 `xor` 4294967295 = 1 +4294967294 `xor` 0 = 4294967294 +4294967294 `xor` 1 = 4294967295 +4294967294 `xor` 2 = 4294967292 +4294967294 `xor` 3 = 4294967293 + +4294967295 `xor` 4294967293 = 2 +4294967295 `xor` 4294967294 = 1 +4294967295 `xor` 4294967295 = 0 +4294967295 `xor` 0 = 4294967295 +4294967295 `xor` 1 = 4294967294 +4294967295 `xor` 2 = 4294967293 +4294967295 `xor` 3 = 4294967292 + +0 `xor` 4294967293 = 4294967293 +0 `xor` 4294967294 = 4294967294 +0 `xor` 4294967295 = 4294967295 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 4294967293 = 4294967292 +1 `xor` 4294967294 = 4294967295 +1 `xor` 4294967295 = 4294967294 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 4294967293 = 4294967295 +2 `xor` 4294967294 = 4294967292 +2 `xor` 4294967295 = 4294967293 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 4294967293 = 4294967294 +3 `xor` 4294967294 = 4294967293 +3 `xor` 4294967295 = 4294967292 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 4294967293 = 2 +complement 4294967294 = 1 +complement 4294967295 = 0 +complement 0 = 4294967295 +complement 1 = 4294967294 +complement 2 = 4294967293 +complement 3 = 4294967292 +# +4294967293 `shiftL` 0 = 4294967293 +4294967293 `shiftL` 1 = 4294967290 +4294967293 `shiftL` 2 = 4294967284 +4294967293 `shiftL` 3 = 4294967272 +4294967293 `shiftL` 32 = 0 +4294967293 `shiftL` 64 = 0 + +4294967294 `shiftL` 0 = 4294967294 +4294967294 `shiftL` 1 = 4294967292 +4294967294 `shiftL` 2 = 4294967288 +4294967294 `shiftL` 3 = 4294967280 +4294967294 `shiftL` 32 = 0 +4294967294 `shiftL` 64 = 0 + +4294967295 `shiftL` 0 = 4294967295 +4294967295 `shiftL` 1 = 4294967294 +4294967295 `shiftL` 2 = 4294967292 +4294967295 `shiftL` 3 = 4294967288 +4294967295 `shiftL` 32 = 0 +4294967295 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +4294967293 `shiftR` 0 = 4294967293 +4294967293 `shiftR` 1 = 2147483646 +4294967293 `shiftR` 2 = 1073741823 +4294967293 `shiftR` 3 = 536870911 +4294967293 `shiftR` 32 = 0 +4294967293 `shiftR` 64 = 0 + +4294967294 `shiftR` 0 = 4294967294 +4294967294 `shiftR` 1 = 2147483647 +4294967294 `shiftR` 2 = 1073741823 +4294967294 `shiftR` 3 = 536870911 +4294967294 `shiftR` 32 = 0 +4294967294 `shiftR` 64 = 0 + +4294967295 `shiftR` 0 = 4294967295 +4294967295 `shiftR` 1 = 2147483647 +4294967295 `shiftR` 2 = 1073741823 +4294967295 `shiftR` 3 = 536870911 +4294967295 `shiftR` 32 = 0 +4294967295 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +4294967293 `rotate` -3 = 3221225471 +4294967293 `rotate` -2 = 2147483647 +4294967293 `rotate` -1 = 4294967294 +4294967293 `rotate` 0 = 4294967293 +4294967293 `rotate` 1 = 4294967291 +4294967293 `rotate` 2 = 4294967287 +4294967293 `rotate` 3 = 4294967279 + +4294967294 `rotate` -3 = 3758096383 +4294967294 `rotate` -2 = 3221225471 +4294967294 `rotate` -1 = 2147483647 +4294967294 `rotate` 0 = 4294967294 +4294967294 `rotate` 1 = 4294967293 +4294967294 `rotate` 2 = 4294967291 +4294967294 `rotate` 3 = 4294967287 + +4294967295 `rotate` -3 = 4294967295 +4294967295 `rotate` -2 = 4294967295 +4294967295 `rotate` -1 = 4294967295 +4294967295 `rotate` 0 = 4294967295 +4294967295 `rotate` 1 = 4294967295 +4294967295 `rotate` 2 = 4294967295 +4294967295 `rotate` 3 = 4294967295 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 536870912 +1 `rotate` -2 = 1073741824 +1 `rotate` -1 = 2147483648 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 1073741824 +2 `rotate` -2 = 2147483648 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 1610612736 +3 `rotate` -2 = 3221225472 +3 `rotate` -1 = 2147483649 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +4294967293 `setBit` 0 = 4294967293 +4294967293 `setBit` 1 = 4294967295 +4294967293 `setBit` 2 = 4294967293 +4294967293 `setBit` 3 = 4294967293 +4294967293 `setBit` 32 = 4294967293 +4294967293 `setBit` 64 = 4294967293 + +4294967294 `setBit` 0 = 4294967295 +4294967294 `setBit` 1 = 4294967294 +4294967294 `setBit` 2 = 4294967294 +4294967294 `setBit` 3 = 4294967294 +4294967294 `setBit` 32 = 4294967294 +4294967294 `setBit` 64 = 4294967294 + +4294967295 `setBit` 0 = 4294967295 +4294967295 `setBit` 1 = 4294967295 +4294967295 `setBit` 2 = 4294967295 +4294967295 `setBit` 3 = 4294967295 +4294967295 `setBit` 32 = 4294967295 +4294967295 `setBit` 64 = 4294967295 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +4294967293 `clearBit` 0 = 4294967292 +4294967293 `clearBit` 1 = 4294967293 +4294967293 `clearBit` 2 = 4294967289 +4294967293 `clearBit` 3 = 4294967285 +4294967293 `clearBit` 32 = 4294967293 +4294967293 `clearBit` 64 = 4294967293 + +4294967294 `clearBit` 0 = 4294967294 +4294967294 `clearBit` 1 = 4294967292 +4294967294 `clearBit` 2 = 4294967290 +4294967294 `clearBit` 3 = 4294967286 +4294967294 `clearBit` 32 = 4294967294 +4294967294 `clearBit` 64 = 4294967294 + +4294967295 `clearBit` 0 = 4294967294 +4294967295 `clearBit` 1 = 4294967293 +4294967295 `clearBit` 2 = 4294967291 +4294967295 `clearBit` 3 = 4294967287 +4294967295 `clearBit` 32 = 4294967295 +4294967295 `clearBit` 64 = 4294967295 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +4294967293 `complementBit` 0 = 4294967292 +4294967293 `complementBit` 1 = 4294967295 +4294967293 `complementBit` 2 = 4294967289 +4294967293 `complementBit` 3 = 4294967285 +4294967293 `complementBit` 32 = 4294967293 +4294967293 `complementBit` 64 = 4294967293 + +4294967294 `complementBit` 0 = 4294967295 +4294967294 `complementBit` 1 = 4294967292 +4294967294 `complementBit` 2 = 4294967290 +4294967294 `complementBit` 3 = 4294967286 +4294967294 `complementBit` 32 = 4294967294 +4294967294 `complementBit` 64 = 4294967294 + +4294967295 `complementBit` 0 = 4294967294 +4294967295 `complementBit` 1 = 4294967293 +4294967295 `complementBit` 2 = 4294967291 +4294967295 `complementBit` 3 = 4294967287 +4294967295 `complementBit` 32 = 4294967295 +4294967295 `complementBit` 64 = 4294967295 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +4294967293 `testBit` 0 = True +4294967293 `testBit` 1 = False +4294967293 `testBit` 2 = True +4294967293 `testBit` 3 = True +4294967293 `testBit` 32 = False +4294967293 `testBit` 64 = False + +4294967294 `testBit` 0 = False +4294967294 `testBit` 1 = True +4294967294 `testBit` 2 = True +4294967294 `testBit` 3 = True +4294967294 `testBit` 32 = False +4294967294 `testBit` 64 = False + +4294967295 `testBit` 0 = True +4294967295 `testBit` 1 = True +4294967295 `testBit` 2 = True +4294967295 `testBit` 3 = True +4294967295 `testBit` 32 = False +4294967295 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 4294967293 = 32 +bitSize 4294967294 = 32 +bitSize 4294967295 = 32 +bitSize 0 = 32 +bitSize 1 = 32 +bitSize 2 = 32 +bitSize 3 = 32 +# +isSigned 4294967293 = False +isSigned 4294967294 = False +isSigned 4294967295 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word64 +-------------------------------- +testBounded +(18446744073709551615,0,1) +(18446744073709551614,18446744073709551615,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[18446744073709551613,18446744073709551614,18446744073709551615,0,1,2,3] +[18446744073709551613,18446744073709551614,18446744073709551615,0,1,2,3] +testEq +18446744073709551613 == 18446744073709551613 = True +18446744073709551613 == 18446744073709551614 = False +18446744073709551613 == 18446744073709551615 = False +18446744073709551613 == 0 = False +18446744073709551613 == 1 = False +18446744073709551613 == 2 = False +18446744073709551613 == 3 = False + +18446744073709551614 == 18446744073709551613 = False +18446744073709551614 == 18446744073709551614 = True +18446744073709551614 == 18446744073709551615 = False +18446744073709551614 == 0 = False +18446744073709551614 == 1 = False +18446744073709551614 == 2 = False +18446744073709551614 == 3 = False + +18446744073709551615 == 18446744073709551613 = False +18446744073709551615 == 18446744073709551614 = False +18446744073709551615 == 18446744073709551615 = True +18446744073709551615 == 0 = False +18446744073709551615 == 1 = False +18446744073709551615 == 2 = False +18446744073709551615 == 3 = False + +0 == 18446744073709551613 = False +0 == 18446744073709551614 = False +0 == 18446744073709551615 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 18446744073709551613 = False +1 == 18446744073709551614 = False +1 == 18446744073709551615 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 18446744073709551613 = False +2 == 18446744073709551614 = False +2 == 18446744073709551615 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 18446744073709551613 = False +3 == 18446744073709551614 = False +3 == 18446744073709551615 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +18446744073709551613 /= 18446744073709551613 = False +18446744073709551613 /= 18446744073709551614 = True +18446744073709551613 /= 18446744073709551615 = True +18446744073709551613 /= 0 = True +18446744073709551613 /= 1 = True +18446744073709551613 /= 2 = True +18446744073709551613 /= 3 = True + +18446744073709551614 /= 18446744073709551613 = True +18446744073709551614 /= 18446744073709551614 = False +18446744073709551614 /= 18446744073709551615 = True +18446744073709551614 /= 0 = True +18446744073709551614 /= 1 = True +18446744073709551614 /= 2 = True +18446744073709551614 /= 3 = True + +18446744073709551615 /= 18446744073709551613 = True +18446744073709551615 /= 18446744073709551614 = True +18446744073709551615 /= 18446744073709551615 = False +18446744073709551615 /= 0 = True +18446744073709551615 /= 1 = True +18446744073709551615 /= 2 = True +18446744073709551615 /= 3 = True + +0 /= 18446744073709551613 = True +0 /= 18446744073709551614 = True +0 /= 18446744073709551615 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 18446744073709551613 = True +1 /= 18446744073709551614 = True +1 /= 18446744073709551615 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 18446744073709551613 = True +2 /= 18446744073709551614 = True +2 /= 18446744073709551615 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 18446744073709551613 = True +3 /= 18446744073709551614 = True +3 /= 18446744073709551615 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +18446744073709551613 <= 18446744073709551613 = True +18446744073709551613 <= 18446744073709551614 = True +18446744073709551613 <= 18446744073709551615 = True +18446744073709551613 <= 0 = False +18446744073709551613 <= 1 = False +18446744073709551613 <= 2 = False +18446744073709551613 <= 3 = False + +18446744073709551614 <= 18446744073709551613 = False +18446744073709551614 <= 18446744073709551614 = True +18446744073709551614 <= 18446744073709551615 = True +18446744073709551614 <= 0 = False +18446744073709551614 <= 1 = False +18446744073709551614 <= 2 = False +18446744073709551614 <= 3 = False + +18446744073709551615 <= 18446744073709551613 = False +18446744073709551615 <= 18446744073709551614 = False +18446744073709551615 <= 18446744073709551615 = True +18446744073709551615 <= 0 = False +18446744073709551615 <= 1 = False +18446744073709551615 <= 2 = False +18446744073709551615 <= 3 = False + +0 <= 18446744073709551613 = True +0 <= 18446744073709551614 = True +0 <= 18446744073709551615 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 18446744073709551613 = True +1 <= 18446744073709551614 = True +1 <= 18446744073709551615 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 18446744073709551613 = True +2 <= 18446744073709551614 = True +2 <= 18446744073709551615 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 18446744073709551613 = True +3 <= 18446744073709551614 = True +3 <= 18446744073709551615 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +18446744073709551613 < 18446744073709551613 = False +18446744073709551613 < 18446744073709551614 = True +18446744073709551613 < 18446744073709551615 = True +18446744073709551613 < 0 = False +18446744073709551613 < 1 = False +18446744073709551613 < 2 = False +18446744073709551613 < 3 = False + +18446744073709551614 < 18446744073709551613 = False +18446744073709551614 < 18446744073709551614 = False +18446744073709551614 < 18446744073709551615 = True +18446744073709551614 < 0 = False +18446744073709551614 < 1 = False +18446744073709551614 < 2 = False +18446744073709551614 < 3 = False + +18446744073709551615 < 18446744073709551613 = False +18446744073709551615 < 18446744073709551614 = False +18446744073709551615 < 18446744073709551615 = False +18446744073709551615 < 0 = False +18446744073709551615 < 1 = False +18446744073709551615 < 2 = False +18446744073709551615 < 3 = False + +0 < 18446744073709551613 = True +0 < 18446744073709551614 = True +0 < 18446744073709551615 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 18446744073709551613 = True +1 < 18446744073709551614 = True +1 < 18446744073709551615 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 18446744073709551613 = True +2 < 18446744073709551614 = True +2 < 18446744073709551615 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 18446744073709551613 = True +3 < 18446744073709551614 = True +3 < 18446744073709551615 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +18446744073709551613 > 18446744073709551613 = False +18446744073709551613 > 18446744073709551614 = False +18446744073709551613 > 18446744073709551615 = False +18446744073709551613 > 0 = True +18446744073709551613 > 1 = True +18446744073709551613 > 2 = True +18446744073709551613 > 3 = True + +18446744073709551614 > 18446744073709551613 = True +18446744073709551614 > 18446744073709551614 = False +18446744073709551614 > 18446744073709551615 = False +18446744073709551614 > 0 = True +18446744073709551614 > 1 = True +18446744073709551614 > 2 = True +18446744073709551614 > 3 = True + +18446744073709551615 > 18446744073709551613 = True +18446744073709551615 > 18446744073709551614 = True +18446744073709551615 > 18446744073709551615 = False +18446744073709551615 > 0 = True +18446744073709551615 > 1 = True +18446744073709551615 > 2 = True +18446744073709551615 > 3 = True + +0 > 18446744073709551613 = False +0 > 18446744073709551614 = False +0 > 18446744073709551615 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 18446744073709551613 = False +1 > 18446744073709551614 = False +1 > 18446744073709551615 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 18446744073709551613 = False +2 > 18446744073709551614 = False +2 > 18446744073709551615 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 18446744073709551613 = False +3 > 18446744073709551614 = False +3 > 18446744073709551615 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +18446744073709551613 >= 18446744073709551613 = True +18446744073709551613 >= 18446744073709551614 = False +18446744073709551613 >= 18446744073709551615 = False +18446744073709551613 >= 0 = True +18446744073709551613 >= 1 = True +18446744073709551613 >= 2 = True +18446744073709551613 >= 3 = True + +18446744073709551614 >= 18446744073709551613 = True +18446744073709551614 >= 18446744073709551614 = True +18446744073709551614 >= 18446744073709551615 = False +18446744073709551614 >= 0 = True +18446744073709551614 >= 1 = True +18446744073709551614 >= 2 = True +18446744073709551614 >= 3 = True + +18446744073709551615 >= 18446744073709551613 = True +18446744073709551615 >= 18446744073709551614 = True +18446744073709551615 >= 18446744073709551615 = True +18446744073709551615 >= 0 = True +18446744073709551615 >= 1 = True +18446744073709551615 >= 2 = True +18446744073709551615 >= 3 = True + +0 >= 18446744073709551613 = False +0 >= 18446744073709551614 = False +0 >= 18446744073709551615 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 18446744073709551613 = False +1 >= 18446744073709551614 = False +1 >= 18446744073709551615 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 18446744073709551613 = False +2 >= 18446744073709551614 = False +2 >= 18446744073709551615 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 18446744073709551613 = False +3 >= 18446744073709551614 = False +3 >= 18446744073709551615 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +18446744073709551613 `compare` 18446744073709551613 = EQ +18446744073709551613 `compare` 18446744073709551614 = LT +18446744073709551613 `compare` 18446744073709551615 = LT +18446744073709551613 `compare` 0 = GT +18446744073709551613 `compare` 1 = GT +18446744073709551613 `compare` 2 = GT +18446744073709551613 `compare` 3 = GT + +18446744073709551614 `compare` 18446744073709551613 = GT +18446744073709551614 `compare` 18446744073709551614 = EQ +18446744073709551614 `compare` 18446744073709551615 = LT +18446744073709551614 `compare` 0 = GT +18446744073709551614 `compare` 1 = GT +18446744073709551614 `compare` 2 = GT +18446744073709551614 `compare` 3 = GT + +18446744073709551615 `compare` 18446744073709551613 = GT +18446744073709551615 `compare` 18446744073709551614 = GT +18446744073709551615 `compare` 18446744073709551615 = EQ +18446744073709551615 `compare` 0 = GT +18446744073709551615 `compare` 1 = GT +18446744073709551615 `compare` 2 = GT +18446744073709551615 `compare` 3 = GT + +0 `compare` 18446744073709551613 = LT +0 `compare` 18446744073709551614 = LT +0 `compare` 18446744073709551615 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 18446744073709551613 = LT +1 `compare` 18446744073709551614 = LT +1 `compare` 18446744073709551615 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 18446744073709551613 = LT +2 `compare` 18446744073709551614 = LT +2 `compare` 18446744073709551615 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 18446744073709551613 = LT +3 `compare` 18446744073709551614 = LT +3 `compare` 18446744073709551615 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +18446744073709551613 + 18446744073709551613 = 18446744073709551610 +18446744073709551613 + 18446744073709551614 = 18446744073709551611 +18446744073709551613 + 18446744073709551615 = 18446744073709551612 +18446744073709551613 + 0 = 18446744073709551613 +18446744073709551613 + 1 = 18446744073709551614 +18446744073709551613 + 2 = 18446744073709551615 +18446744073709551613 + 3 = 0 + +18446744073709551614 + 18446744073709551613 = 18446744073709551611 +18446744073709551614 + 18446744073709551614 = 18446744073709551612 +18446744073709551614 + 18446744073709551615 = 18446744073709551613 +18446744073709551614 + 0 = 18446744073709551614 +18446744073709551614 + 1 = 18446744073709551615 +18446744073709551614 + 2 = 0 +18446744073709551614 + 3 = 1 + +18446744073709551615 + 18446744073709551613 = 18446744073709551612 +18446744073709551615 + 18446744073709551614 = 18446744073709551613 +18446744073709551615 + 18446744073709551615 = 18446744073709551614 +18446744073709551615 + 0 = 18446744073709551615 +18446744073709551615 + 1 = 0 +18446744073709551615 + 2 = 1 +18446744073709551615 + 3 = 2 + +0 + 18446744073709551613 = 18446744073709551613 +0 + 18446744073709551614 = 18446744073709551614 +0 + 18446744073709551615 = 18446744073709551615 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 18446744073709551613 = 18446744073709551614 +1 + 18446744073709551614 = 18446744073709551615 +1 + 18446744073709551615 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 18446744073709551613 = 18446744073709551615 +2 + 18446744073709551614 = 0 +2 + 18446744073709551615 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 18446744073709551613 = 0 +3 + 18446744073709551614 = 1 +3 + 18446744073709551615 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +18446744073709551613 - 18446744073709551613 = 0 +18446744073709551613 - 18446744073709551614 = 18446744073709551615 +18446744073709551613 - 18446744073709551615 = 18446744073709551614 +18446744073709551613 - 0 = 18446744073709551613 +18446744073709551613 - 1 = 18446744073709551612 +18446744073709551613 - 2 = 18446744073709551611 +18446744073709551613 - 3 = 18446744073709551610 + +18446744073709551614 - 18446744073709551613 = 1 +18446744073709551614 - 18446744073709551614 = 0 +18446744073709551614 - 18446744073709551615 = 18446744073709551615 +18446744073709551614 - 0 = 18446744073709551614 +18446744073709551614 - 1 = 18446744073709551613 +18446744073709551614 - 2 = 18446744073709551612 +18446744073709551614 - 3 = 18446744073709551611 + +18446744073709551615 - 18446744073709551613 = 2 +18446744073709551615 - 18446744073709551614 = 1 +18446744073709551615 - 18446744073709551615 = 0 +18446744073709551615 - 0 = 18446744073709551615 +18446744073709551615 - 1 = 18446744073709551614 +18446744073709551615 - 2 = 18446744073709551613 +18446744073709551615 - 3 = 18446744073709551612 + +0 - 18446744073709551613 = 3 +0 - 18446744073709551614 = 2 +0 - 18446744073709551615 = 1 +0 - 0 = 0 +0 - 1 = 18446744073709551615 +0 - 2 = 18446744073709551614 +0 - 3 = 18446744073709551613 + +1 - 18446744073709551613 = 4 +1 - 18446744073709551614 = 3 +1 - 18446744073709551615 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 18446744073709551615 +1 - 3 = 18446744073709551614 + +2 - 18446744073709551613 = 5 +2 - 18446744073709551614 = 4 +2 - 18446744073709551615 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 18446744073709551615 + +3 - 18446744073709551613 = 6 +3 - 18446744073709551614 = 5 +3 - 18446744073709551615 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +18446744073709551613 * 18446744073709551613 = 9 +18446744073709551613 * 18446744073709551614 = 6 +18446744073709551613 * 18446744073709551615 = 3 +18446744073709551613 * 0 = 0 +18446744073709551613 * 1 = 18446744073709551613 +18446744073709551613 * 2 = 18446744073709551610 +18446744073709551613 * 3 = 18446744073709551607 + +18446744073709551614 * 18446744073709551613 = 6 +18446744073709551614 * 18446744073709551614 = 4 +18446744073709551614 * 18446744073709551615 = 2 +18446744073709551614 * 0 = 0 +18446744073709551614 * 1 = 18446744073709551614 +18446744073709551614 * 2 = 18446744073709551612 +18446744073709551614 * 3 = 18446744073709551610 + +18446744073709551615 * 18446744073709551613 = 3 +18446744073709551615 * 18446744073709551614 = 2 +18446744073709551615 * 18446744073709551615 = 1 +18446744073709551615 * 0 = 0 +18446744073709551615 * 1 = 18446744073709551615 +18446744073709551615 * 2 = 18446744073709551614 +18446744073709551615 * 3 = 18446744073709551613 + +0 * 18446744073709551613 = 0 +0 * 18446744073709551614 = 0 +0 * 18446744073709551615 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 18446744073709551613 = 18446744073709551613 +1 * 18446744073709551614 = 18446744073709551614 +1 * 18446744073709551615 = 18446744073709551615 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 18446744073709551613 = 18446744073709551610 +2 * 18446744073709551614 = 18446744073709551612 +2 * 18446744073709551615 = 18446744073709551614 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 18446744073709551613 = 18446744073709551607 +3 * 18446744073709551614 = 18446744073709551610 +3 * 18446744073709551615 = 18446744073709551613 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 18446744073709551613 = 3 +negate 18446744073709551614 = 2 +negate 18446744073709551615 = 1 +negate 0 = 0 +negate 1 = 18446744073709551615 +negate 2 = 18446744073709551614 +negate 3 = 18446744073709551613 +# +testReal +toRational 18446744073709551613 = 18446744073709551613 % 1 +toRational 18446744073709551614 = 18446744073709551614 % 1 +toRational 18446744073709551615 = 18446744073709551615 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +18446744073709551613 `divMod` 18446744073709551613 = (1,0) +18446744073709551613 `divMod` 18446744073709551614 = (0,18446744073709551613) +18446744073709551613 `divMod` 18446744073709551615 = (0,18446744073709551613) +18446744073709551613 `divMod` 0 = divide by zero +18446744073709551613 `divMod` 1 = (18446744073709551613,0) +18446744073709551613 `divMod` 2 = (9223372036854775806,1) +18446744073709551613 `divMod` 3 = (6148914691236517204,1) + +18446744073709551614 `divMod` 18446744073709551613 = (1,1) +18446744073709551614 `divMod` 18446744073709551614 = (1,0) +18446744073709551614 `divMod` 18446744073709551615 = (0,18446744073709551614) +18446744073709551614 `divMod` 0 = divide by zero +18446744073709551614 `divMod` 1 = (18446744073709551614,0) +18446744073709551614 `divMod` 2 = (9223372036854775807,0) +18446744073709551614 `divMod` 3 = (6148914691236517204,2) + +18446744073709551615 `divMod` 18446744073709551613 = (1,2) +18446744073709551615 `divMod` 18446744073709551614 = (1,1) +18446744073709551615 `divMod` 18446744073709551615 = (1,0) +18446744073709551615 `divMod` 0 = divide by zero +18446744073709551615 `divMod` 1 = (18446744073709551615,0) +18446744073709551615 `divMod` 2 = (9223372036854775807,1) +18446744073709551615 `divMod` 3 = (6148914691236517205,0) + +0 `divMod` 18446744073709551613 = (0,0) +0 `divMod` 18446744073709551614 = (0,0) +0 `divMod` 18446744073709551615 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 18446744073709551613 = (0,1) +1 `divMod` 18446744073709551614 = (0,1) +1 `divMod` 18446744073709551615 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 18446744073709551613 = (0,2) +2 `divMod` 18446744073709551614 = (0,2) +2 `divMod` 18446744073709551615 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 18446744073709551613 = (0,3) +3 `divMod` 18446744073709551614 = (0,3) +3 `divMod` 18446744073709551615 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +18446744073709551613 `div` 18446744073709551613 = 1 +18446744073709551613 `div` 18446744073709551614 = 0 +18446744073709551613 `div` 18446744073709551615 = 0 +18446744073709551613 `div` 0 = divide by zero +18446744073709551613 `div` 1 = 18446744073709551613 +18446744073709551613 `div` 2 = 9223372036854775806 +18446744073709551613 `div` 3 = 6148914691236517204 + +18446744073709551614 `div` 18446744073709551613 = 1 +18446744073709551614 `div` 18446744073709551614 = 1 +18446744073709551614 `div` 18446744073709551615 = 0 +18446744073709551614 `div` 0 = divide by zero +18446744073709551614 `div` 1 = 18446744073709551614 +18446744073709551614 `div` 2 = 9223372036854775807 +18446744073709551614 `div` 3 = 6148914691236517204 + +18446744073709551615 `div` 18446744073709551613 = 1 +18446744073709551615 `div` 18446744073709551614 = 1 +18446744073709551615 `div` 18446744073709551615 = 1 +18446744073709551615 `div` 0 = divide by zero +18446744073709551615 `div` 1 = 18446744073709551615 +18446744073709551615 `div` 2 = 9223372036854775807 +18446744073709551615 `div` 3 = 6148914691236517205 + +0 `div` 18446744073709551613 = 0 +0 `div` 18446744073709551614 = 0 +0 `div` 18446744073709551615 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 18446744073709551613 = 0 +1 `div` 18446744073709551614 = 0 +1 `div` 18446744073709551615 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 18446744073709551613 = 0 +2 `div` 18446744073709551614 = 0 +2 `div` 18446744073709551615 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 18446744073709551613 = 0 +3 `div` 18446744073709551614 = 0 +3 `div` 18446744073709551615 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +18446744073709551613 `mod` 18446744073709551613 = 0 +18446744073709551613 `mod` 18446744073709551614 = 18446744073709551613 +18446744073709551613 `mod` 18446744073709551615 = 18446744073709551613 +18446744073709551613 `mod` 0 = divide by zero +18446744073709551613 `mod` 1 = 0 +18446744073709551613 `mod` 2 = 1 +18446744073709551613 `mod` 3 = 1 + +18446744073709551614 `mod` 18446744073709551613 = 1 +18446744073709551614 `mod` 18446744073709551614 = 0 +18446744073709551614 `mod` 18446744073709551615 = 18446744073709551614 +18446744073709551614 `mod` 0 = divide by zero +18446744073709551614 `mod` 1 = 0 +18446744073709551614 `mod` 2 = 0 +18446744073709551614 `mod` 3 = 2 + +18446744073709551615 `mod` 18446744073709551613 = 2 +18446744073709551615 `mod` 18446744073709551614 = 1 +18446744073709551615 `mod` 18446744073709551615 = 0 +18446744073709551615 `mod` 0 = divide by zero +18446744073709551615 `mod` 1 = 0 +18446744073709551615 `mod` 2 = 1 +18446744073709551615 `mod` 3 = 0 + +0 `mod` 18446744073709551613 = 0 +0 `mod` 18446744073709551614 = 0 +0 `mod` 18446744073709551615 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 18446744073709551613 = 1 +1 `mod` 18446744073709551614 = 1 +1 `mod` 18446744073709551615 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 18446744073709551613 = 2 +2 `mod` 18446744073709551614 = 2 +2 `mod` 18446744073709551615 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 18446744073709551613 = 3 +3 `mod` 18446744073709551614 = 3 +3 `mod` 18446744073709551615 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +18446744073709551613 `quotRem` 18446744073709551613 = (1,0) +18446744073709551613 `quotRem` 18446744073709551614 = (0,18446744073709551613) +18446744073709551613 `quotRem` 18446744073709551615 = (0,18446744073709551613) +18446744073709551613 `quotRem` 0 = divide by zero +18446744073709551613 `quotRem` 1 = (18446744073709551613,0) +18446744073709551613 `quotRem` 2 = (9223372036854775806,1) +18446744073709551613 `quotRem` 3 = (6148914691236517204,1) + +18446744073709551614 `quotRem` 18446744073709551613 = (1,1) +18446744073709551614 `quotRem` 18446744073709551614 = (1,0) +18446744073709551614 `quotRem` 18446744073709551615 = (0,18446744073709551614) +18446744073709551614 `quotRem` 0 = divide by zero +18446744073709551614 `quotRem` 1 = (18446744073709551614,0) +18446744073709551614 `quotRem` 2 = (9223372036854775807,0) +18446744073709551614 `quotRem` 3 = (6148914691236517204,2) + +18446744073709551615 `quotRem` 18446744073709551613 = (1,2) +18446744073709551615 `quotRem` 18446744073709551614 = (1,1) +18446744073709551615 `quotRem` 18446744073709551615 = (1,0) +18446744073709551615 `quotRem` 0 = divide by zero +18446744073709551615 `quotRem` 1 = (18446744073709551615,0) +18446744073709551615 `quotRem` 2 = (9223372036854775807,1) +18446744073709551615 `quotRem` 3 = (6148914691236517205,0) + +0 `quotRem` 18446744073709551613 = (0,0) +0 `quotRem` 18446744073709551614 = (0,0) +0 `quotRem` 18446744073709551615 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 18446744073709551613 = (0,1) +1 `quotRem` 18446744073709551614 = (0,1) +1 `quotRem` 18446744073709551615 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 18446744073709551613 = (0,2) +2 `quotRem` 18446744073709551614 = (0,2) +2 `quotRem` 18446744073709551615 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 18446744073709551613 = (0,3) +3 `quotRem` 18446744073709551614 = (0,3) +3 `quotRem` 18446744073709551615 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +18446744073709551613 `quot` 18446744073709551613 = 1 +18446744073709551613 `quot` 18446744073709551614 = 0 +18446744073709551613 `quot` 18446744073709551615 = 0 +18446744073709551613 `quot` 0 = divide by zero +18446744073709551613 `quot` 1 = 18446744073709551613 +18446744073709551613 `quot` 2 = 9223372036854775806 +18446744073709551613 `quot` 3 = 6148914691236517204 + +18446744073709551614 `quot` 18446744073709551613 = 1 +18446744073709551614 `quot` 18446744073709551614 = 1 +18446744073709551614 `quot` 18446744073709551615 = 0 +18446744073709551614 `quot` 0 = divide by zero +18446744073709551614 `quot` 1 = 18446744073709551614 +18446744073709551614 `quot` 2 = 9223372036854775807 +18446744073709551614 `quot` 3 = 6148914691236517204 + +18446744073709551615 `quot` 18446744073709551613 = 1 +18446744073709551615 `quot` 18446744073709551614 = 1 +18446744073709551615 `quot` 18446744073709551615 = 1 +18446744073709551615 `quot` 0 = divide by zero +18446744073709551615 `quot` 1 = 18446744073709551615 +18446744073709551615 `quot` 2 = 9223372036854775807 +18446744073709551615 `quot` 3 = 6148914691236517205 + +0 `quot` 18446744073709551613 = 0 +0 `quot` 18446744073709551614 = 0 +0 `quot` 18446744073709551615 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 18446744073709551613 = 0 +1 `quot` 18446744073709551614 = 0 +1 `quot` 18446744073709551615 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 18446744073709551613 = 0 +2 `quot` 18446744073709551614 = 0 +2 `quot` 18446744073709551615 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 18446744073709551613 = 0 +3 `quot` 18446744073709551614 = 0 +3 `quot` 18446744073709551615 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +18446744073709551613 `rem` 18446744073709551613 = 0 +18446744073709551613 `rem` 18446744073709551614 = 18446744073709551613 +18446744073709551613 `rem` 18446744073709551615 = 18446744073709551613 +18446744073709551613 `rem` 0 = divide by zero +18446744073709551613 `rem` 1 = 0 +18446744073709551613 `rem` 2 = 1 +18446744073709551613 `rem` 3 = 1 + +18446744073709551614 `rem` 18446744073709551613 = 1 +18446744073709551614 `rem` 18446744073709551614 = 0 +18446744073709551614 `rem` 18446744073709551615 = 18446744073709551614 +18446744073709551614 `rem` 0 = divide by zero +18446744073709551614 `rem` 1 = 0 +18446744073709551614 `rem` 2 = 0 +18446744073709551614 `rem` 3 = 2 + +18446744073709551615 `rem` 18446744073709551613 = 2 +18446744073709551615 `rem` 18446744073709551614 = 1 +18446744073709551615 `rem` 18446744073709551615 = 0 +18446744073709551615 `rem` 0 = divide by zero +18446744073709551615 `rem` 1 = 0 +18446744073709551615 `rem` 2 = 1 +18446744073709551615 `rem` 3 = 0 + +0 `rem` 18446744073709551613 = 0 +0 `rem` 18446744073709551614 = 0 +0 `rem` 18446744073709551615 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 18446744073709551613 = 1 +1 `rem` 18446744073709551614 = 1 +1 `rem` 18446744073709551615 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 18446744073709551613 = 2 +2 `rem` 18446744073709551614 = 2 +2 `rem` 18446744073709551615 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 18446744073709551613 = 3 +3 `rem` 18446744073709551614 = 3 +3 `rem` 18446744073709551615 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,18446744073709551615] +Int : [0,0,-1] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [0,0,-1] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [0,0,18446744073709551615] +testBits +18446744073709551613 .&. 18446744073709551613 = 18446744073709551613 +18446744073709551613 .&. 18446744073709551614 = 18446744073709551612 +18446744073709551613 .&. 18446744073709551615 = 18446744073709551613 +18446744073709551613 .&. 0 = 0 +18446744073709551613 .&. 1 = 1 +18446744073709551613 .&. 2 = 0 +18446744073709551613 .&. 3 = 1 + +18446744073709551614 .&. 18446744073709551613 = 18446744073709551612 +18446744073709551614 .&. 18446744073709551614 = 18446744073709551614 +18446744073709551614 .&. 18446744073709551615 = 18446744073709551614 +18446744073709551614 .&. 0 = 0 +18446744073709551614 .&. 1 = 0 +18446744073709551614 .&. 2 = 2 +18446744073709551614 .&. 3 = 2 + +18446744073709551615 .&. 18446744073709551613 = 18446744073709551613 +18446744073709551615 .&. 18446744073709551614 = 18446744073709551614 +18446744073709551615 .&. 18446744073709551615 = 18446744073709551615 +18446744073709551615 .&. 0 = 0 +18446744073709551615 .&. 1 = 1 +18446744073709551615 .&. 2 = 2 +18446744073709551615 .&. 3 = 3 + +0 .&. 18446744073709551613 = 0 +0 .&. 18446744073709551614 = 0 +0 .&. 18446744073709551615 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 18446744073709551613 = 1 +1 .&. 18446744073709551614 = 0 +1 .&. 18446744073709551615 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 18446744073709551613 = 0 +2 .&. 18446744073709551614 = 2 +2 .&. 18446744073709551615 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 18446744073709551613 = 1 +3 .&. 18446744073709551614 = 2 +3 .&. 18446744073709551615 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +18446744073709551613 .|. 18446744073709551613 = 18446744073709551613 +18446744073709551613 .|. 18446744073709551614 = 18446744073709551615 +18446744073709551613 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551613 .|. 0 = 18446744073709551613 +18446744073709551613 .|. 1 = 18446744073709551613 +18446744073709551613 .|. 2 = 18446744073709551615 +18446744073709551613 .|. 3 = 18446744073709551615 + +18446744073709551614 .|. 18446744073709551613 = 18446744073709551615 +18446744073709551614 .|. 18446744073709551614 = 18446744073709551614 +18446744073709551614 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551614 .|. 0 = 18446744073709551614 +18446744073709551614 .|. 1 = 18446744073709551615 +18446744073709551614 .|. 2 = 18446744073709551614 +18446744073709551614 .|. 3 = 18446744073709551615 + +18446744073709551615 .|. 18446744073709551613 = 18446744073709551615 +18446744073709551615 .|. 18446744073709551614 = 18446744073709551615 +18446744073709551615 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551615 .|. 0 = 18446744073709551615 +18446744073709551615 .|. 1 = 18446744073709551615 +18446744073709551615 .|. 2 = 18446744073709551615 +18446744073709551615 .|. 3 = 18446744073709551615 + +0 .|. 18446744073709551613 = 18446744073709551613 +0 .|. 18446744073709551614 = 18446744073709551614 +0 .|. 18446744073709551615 = 18446744073709551615 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 18446744073709551613 = 18446744073709551613 +1 .|. 18446744073709551614 = 18446744073709551615 +1 .|. 18446744073709551615 = 18446744073709551615 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 18446744073709551613 = 18446744073709551615 +2 .|. 18446744073709551614 = 18446744073709551614 +2 .|. 18446744073709551615 = 18446744073709551615 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 18446744073709551613 = 18446744073709551615 +3 .|. 18446744073709551614 = 18446744073709551615 +3 .|. 18446744073709551615 = 18446744073709551615 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +18446744073709551613 `xor` 18446744073709551613 = 0 +18446744073709551613 `xor` 18446744073709551614 = 3 +18446744073709551613 `xor` 18446744073709551615 = 2 +18446744073709551613 `xor` 0 = 18446744073709551613 +18446744073709551613 `xor` 1 = 18446744073709551612 +18446744073709551613 `xor` 2 = 18446744073709551615 +18446744073709551613 `xor` 3 = 18446744073709551614 + +18446744073709551614 `xor` 18446744073709551613 = 3 +18446744073709551614 `xor` 18446744073709551614 = 0 +18446744073709551614 `xor` 18446744073709551615 = 1 +18446744073709551614 `xor` 0 = 18446744073709551614 +18446744073709551614 `xor` 1 = 18446744073709551615 +18446744073709551614 `xor` 2 = 18446744073709551612 +18446744073709551614 `xor` 3 = 18446744073709551613 + +18446744073709551615 `xor` 18446744073709551613 = 2 +18446744073709551615 `xor` 18446744073709551614 = 1 +18446744073709551615 `xor` 18446744073709551615 = 0 +18446744073709551615 `xor` 0 = 18446744073709551615 +18446744073709551615 `xor` 1 = 18446744073709551614 +18446744073709551615 `xor` 2 = 18446744073709551613 +18446744073709551615 `xor` 3 = 18446744073709551612 + +0 `xor` 18446744073709551613 = 18446744073709551613 +0 `xor` 18446744073709551614 = 18446744073709551614 +0 `xor` 18446744073709551615 = 18446744073709551615 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 18446744073709551613 = 18446744073709551612 +1 `xor` 18446744073709551614 = 18446744073709551615 +1 `xor` 18446744073709551615 = 18446744073709551614 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 18446744073709551613 = 18446744073709551615 +2 `xor` 18446744073709551614 = 18446744073709551612 +2 `xor` 18446744073709551615 = 18446744073709551613 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 18446744073709551613 = 18446744073709551614 +3 `xor` 18446744073709551614 = 18446744073709551613 +3 `xor` 18446744073709551615 = 18446744073709551612 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 18446744073709551613 = 2 +complement 18446744073709551614 = 1 +complement 18446744073709551615 = 0 +complement 0 = 18446744073709551615 +complement 1 = 18446744073709551614 +complement 2 = 18446744073709551613 +complement 3 = 18446744073709551612 +# +18446744073709551613 `shiftL` 0 = 18446744073709551613 +18446744073709551613 `shiftL` 1 = 18446744073709551610 +18446744073709551613 `shiftL` 2 = 18446744073709551604 +18446744073709551613 `shiftL` 3 = 18446744073709551592 +18446744073709551613 `shiftL` 32 = 18446744060824649728 +18446744073709551613 `shiftL` 64 = 0 + +18446744073709551614 `shiftL` 0 = 18446744073709551614 +18446744073709551614 `shiftL` 1 = 18446744073709551612 +18446744073709551614 `shiftL` 2 = 18446744073709551608 +18446744073709551614 `shiftL` 3 = 18446744073709551600 +18446744073709551614 `shiftL` 32 = 18446744065119617024 +18446744073709551614 `shiftL` 64 = 0 + +18446744073709551615 `shiftL` 0 = 18446744073709551615 +18446744073709551615 `shiftL` 1 = 18446744073709551614 +18446744073709551615 `shiftL` 2 = 18446744073709551612 +18446744073709551615 `shiftL` 3 = 18446744073709551608 +18446744073709551615 `shiftL` 32 = 18446744069414584320 +18446744073709551615 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +18446744073709551613 `shiftR` 0 = 18446744073709551613 +18446744073709551613 `shiftR` 1 = 9223372036854775806 +18446744073709551613 `shiftR` 2 = 4611686018427387903 +18446744073709551613 `shiftR` 3 = 2305843009213693951 +18446744073709551613 `shiftR` 32 = 4294967295 +18446744073709551613 `shiftR` 64 = 0 + +18446744073709551614 `shiftR` 0 = 18446744073709551614 +18446744073709551614 `shiftR` 1 = 9223372036854775807 +18446744073709551614 `shiftR` 2 = 4611686018427387903 +18446744073709551614 `shiftR` 3 = 2305843009213693951 +18446744073709551614 `shiftR` 32 = 4294967295 +18446744073709551614 `shiftR` 64 = 0 + +18446744073709551615 `shiftR` 0 = 18446744073709551615 +18446744073709551615 `shiftR` 1 = 9223372036854775807 +18446744073709551615 `shiftR` 2 = 4611686018427387903 +18446744073709551615 `shiftR` 3 = 2305843009213693951 +18446744073709551615 `shiftR` 32 = 4294967295 +18446744073709551615 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +18446744073709551613 `rotate` -3 = 13835058055282163711 +18446744073709551613 `rotate` -2 = 9223372036854775807 +18446744073709551613 `rotate` -1 = 18446744073709551614 +18446744073709551613 `rotate` 0 = 18446744073709551613 +18446744073709551613 `rotate` 1 = 18446744073709551611 +18446744073709551613 `rotate` 2 = 18446744073709551607 +18446744073709551613 `rotate` 3 = 18446744073709551599 + +18446744073709551614 `rotate` -3 = 16140901064495857663 +18446744073709551614 `rotate` -2 = 13835058055282163711 +18446744073709551614 `rotate` -1 = 9223372036854775807 +18446744073709551614 `rotate` 0 = 18446744073709551614 +18446744073709551614 `rotate` 1 = 18446744073709551613 +18446744073709551614 `rotate` 2 = 18446744073709551611 +18446744073709551614 `rotate` 3 = 18446744073709551607 + +18446744073709551615 `rotate` -3 = 18446744073709551615 +18446744073709551615 `rotate` -2 = 18446744073709551615 +18446744073709551615 `rotate` -1 = 18446744073709551615 +18446744073709551615 `rotate` 0 = 18446744073709551615 +18446744073709551615 `rotate` 1 = 18446744073709551615 +18446744073709551615 `rotate` 2 = 18446744073709551615 +18446744073709551615 `rotate` 3 = 18446744073709551615 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = 9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = 9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = 13835058055282163712 +3 `rotate` -1 = 9223372036854775809 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +18446744073709551613 `setBit` 0 = 18446744073709551613 +18446744073709551613 `setBit` 1 = 18446744073709551615 +18446744073709551613 `setBit` 2 = 18446744073709551613 +18446744073709551613 `setBit` 3 = 18446744073709551613 +18446744073709551613 `setBit` 32 = 18446744073709551613 +18446744073709551613 `setBit` 64 = 18446744073709551613 + +18446744073709551614 `setBit` 0 = 18446744073709551615 +18446744073709551614 `setBit` 1 = 18446744073709551614 +18446744073709551614 `setBit` 2 = 18446744073709551614 +18446744073709551614 `setBit` 3 = 18446744073709551614 +18446744073709551614 `setBit` 32 = 18446744073709551614 +18446744073709551614 `setBit` 64 = 18446744073709551614 + +18446744073709551615 `setBit` 0 = 18446744073709551615 +18446744073709551615 `setBit` 1 = 18446744073709551615 +18446744073709551615 `setBit` 2 = 18446744073709551615 +18446744073709551615 `setBit` 3 = 18446744073709551615 +18446744073709551615 `setBit` 32 = 18446744073709551615 +18446744073709551615 `setBit` 64 = 18446744073709551615 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +18446744073709551613 `clearBit` 0 = 18446744073709551612 +18446744073709551613 `clearBit` 1 = 18446744073709551613 +18446744073709551613 `clearBit` 2 = 18446744073709551609 +18446744073709551613 `clearBit` 3 = 18446744073709551605 +18446744073709551613 `clearBit` 32 = 18446744069414584317 +18446744073709551613 `clearBit` 64 = 18446744073709551613 + +18446744073709551614 `clearBit` 0 = 18446744073709551614 +18446744073709551614 `clearBit` 1 = 18446744073709551612 +18446744073709551614 `clearBit` 2 = 18446744073709551610 +18446744073709551614 `clearBit` 3 = 18446744073709551606 +18446744073709551614 `clearBit` 32 = 18446744069414584318 +18446744073709551614 `clearBit` 64 = 18446744073709551614 + +18446744073709551615 `clearBit` 0 = 18446744073709551614 +18446744073709551615 `clearBit` 1 = 18446744073709551613 +18446744073709551615 `clearBit` 2 = 18446744073709551611 +18446744073709551615 `clearBit` 3 = 18446744073709551607 +18446744073709551615 `clearBit` 32 = 18446744069414584319 +18446744073709551615 `clearBit` 64 = 18446744073709551615 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +18446744073709551613 `complementBit` 0 = 18446744073709551612 +18446744073709551613 `complementBit` 1 = 18446744073709551615 +18446744073709551613 `complementBit` 2 = 18446744073709551609 +18446744073709551613 `complementBit` 3 = 18446744073709551605 +18446744073709551613 `complementBit` 32 = 18446744069414584317 +18446744073709551613 `complementBit` 64 = 18446744073709551613 + +18446744073709551614 `complementBit` 0 = 18446744073709551615 +18446744073709551614 `complementBit` 1 = 18446744073709551612 +18446744073709551614 `complementBit` 2 = 18446744073709551610 +18446744073709551614 `complementBit` 3 = 18446744073709551606 +18446744073709551614 `complementBit` 32 = 18446744069414584318 +18446744073709551614 `complementBit` 64 = 18446744073709551614 + +18446744073709551615 `complementBit` 0 = 18446744073709551614 +18446744073709551615 `complementBit` 1 = 18446744073709551613 +18446744073709551615 `complementBit` 2 = 18446744073709551611 +18446744073709551615 `complementBit` 3 = 18446744073709551607 +18446744073709551615 `complementBit` 32 = 18446744069414584319 +18446744073709551615 `complementBit` 64 = 18446744073709551615 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +18446744073709551613 `testBit` 0 = True +18446744073709551613 `testBit` 1 = False +18446744073709551613 `testBit` 2 = True +18446744073709551613 `testBit` 3 = True +18446744073709551613 `testBit` 32 = True +18446744073709551613 `testBit` 64 = False + +18446744073709551614 `testBit` 0 = False +18446744073709551614 `testBit` 1 = True +18446744073709551614 `testBit` 2 = True +18446744073709551614 `testBit` 3 = True +18446744073709551614 `testBit` 32 = True +18446744073709551614 `testBit` 64 = False + +18446744073709551615 `testBit` 0 = True +18446744073709551615 `testBit` 1 = True +18446744073709551615 `testBit` 2 = True +18446744073709551615 `testBit` 3 = True +18446744073709551615 `testBit` 32 = True +18446744073709551615 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 18446744073709551613 = 64 +bitSize 18446744073709551614 = 64 +bitSize 18446744073709551615 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned 18446744073709551613 = False +isSigned 18446744073709551614 = False +isSigned 18446744073709551615 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Integer +-------------------------------- +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = -55340232221128654848 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = -36893488147419103232 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = -18446744073709551616 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 18446744073709551616 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 36893488147419103232 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 55340232221128654848 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -1 +-3 `rotate` -2 = -1 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -6 +-3 `rotate` 2 = -12 +-3 `rotate` 3 = -24 + +-2 `rotate` -3 = -1 +-2 `rotate` -2 = -1 +-2 `rotate` -1 = -1 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -4 +-2 `rotate` 2 = -8 +-2 `rotate` 3 = -16 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -2 +-1 `rotate` 2 = -4 +-1 `rotate` 3 = -8 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 + +1 `rotate` -3 = 0 +1 `rotate` -2 = 0 +1 `rotate` -1 = 0 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 + +2 `rotate` -3 = 0 +2 `rotate` -2 = 0 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 + +3 `rotate` -3 = 0 +3 `rotate` -2 = 0 +3 `rotate` -1 = 1 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 18446744073709551616 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 18446744073709551617 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 18446744073709551618 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 18446744073709551619 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -18446744073709551619 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -18446744073709551618 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -18446744073709551617 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -18446744073709551619 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -18446744073709551618 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -18446744073709551617 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 18446744073709551616 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 18446744073709551617 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 18446744073709551618 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 18446744073709551619 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = True + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = True + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = True + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# diff --git a/testsuite/tests/numeric/should_run/arith011.stdout-ws-64 b/testsuite/tests/numeric/should_run/arith011.stdout-ws-64 new file mode 100644 index 0000000000..ff064a071d --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith011.stdout-ws-64 @@ -0,0 +1,15418 @@ +-------------------------------- +--Testing Int +-------------------------------- +testBounded +(9223372036854775807,-9223372036854775808,-9223372036854775807) +(9223372036854775806,9223372036854775807,-9223372036854775808) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-9223372036854775808,0,9223372036854775807] +Int : [-9223372036854775808,0,9223372036854775807] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [-9223372036854775808,0,9223372036854775807] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [9223372036854775808,0,9223372036854775807] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -4611686018427387905 +-3 `rotate` -2 = 9223372036854775807 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 +-3 `rotate` -64 = -3 +-3 `rotate` -32 = -8589934593 +-3 `rotate` 32 = -8589934593 +-3 `rotate` 64 = -3 + +-2 `rotate` -3 = -2305843009213693953 +-2 `rotate` -2 = -4611686018427387905 +-2 `rotate` -1 = 9223372036854775807 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 +-2 `rotate` -64 = -2 +-2 `rotate` -32 = -4294967297 +-2 `rotate` 32 = -4294967297 +-2 `rotate` 64 = -2 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -1 +-1 `rotate` 64 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = -9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 4294967296 +1 `rotate` 32 = 4294967296 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = -9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 8589934592 +2 `rotate` 32 = 8589934592 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = -4611686018427387904 +3 `rotate` -1 = -9223372036854775807 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 12884901888 +3 `rotate` 32 = 12884901888 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 64 +bitSize -2 = 64 +bitSize -1 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int8 +-------------------------------- +testBounded +(127,-128,-127) +(126,127,-128) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-128,0,127] +Int : [-128,0,127] +Int8 : [-128,0,127] +Int16 : [-128,0,127] +Int32 : [-128,0,127] +Int64 : [-128,0,127] +Word8 : [128,0,127] +Word16 : [65408,0,127] +Word32 : [4294967168,0,127] +Word64 : [18446744073709551488,0,127] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -65 +-3 `rotate` -2 = 127 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 +-3 `rotate` -64 = -3 +-3 `rotate` -32 = -3 +-3 `rotate` 32 = -3 +-3 `rotate` 64 = -3 + +-2 `rotate` -3 = -33 +-2 `rotate` -2 = -65 +-2 `rotate` -1 = 127 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 +-2 `rotate` -64 = -2 +-2 `rotate` -32 = -2 +-2 `rotate` 32 = -2 +-2 `rotate` 64 = -2 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -1 +-1 `rotate` 64 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 32 +1 `rotate` -2 = 64 +1 `rotate` -1 = -128 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 64 +2 `rotate` -2 = -128 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 96 +3 `rotate` -2 = -64 +3 `rotate` -1 = -127 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 8 +bitSize -2 = 8 +bitSize -1 = 8 +bitSize 0 = 8 +bitSize 1 = 8 +bitSize 2 = 8 +bitSize 3 = 8 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int16 +-------------------------------- +testBounded +(32767,-32768,-32767) +(32766,32767,-32768) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-32768,0,32767] +Int : [-32768,0,32767] +Int8 : [0,0,-1] +Int16 : [-32768,0,32767] +Int32 : [-32768,0,32767] +Int64 : [-32768,0,32767] +Word8 : [0,0,255] +Word16 : [32768,0,32767] +Word32 : [4294934528,0,32767] +Word64 : [18446744073709518848,0,32767] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -16385 +-3 `rotate` -2 = 32767 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 +-3 `rotate` -64 = -3 +-3 `rotate` -32 = -3 +-3 `rotate` 32 = -3 +-3 `rotate` 64 = -3 + +-2 `rotate` -3 = -8193 +-2 `rotate` -2 = -16385 +-2 `rotate` -1 = 32767 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 +-2 `rotate` -64 = -2 +-2 `rotate` -32 = -2 +-2 `rotate` 32 = -2 +-2 `rotate` 64 = -2 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -1 +-1 `rotate` 64 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 8192 +1 `rotate` -2 = 16384 +1 `rotate` -1 = -32768 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 16384 +2 `rotate` -2 = -32768 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 24576 +3 `rotate` -2 = -16384 +3 `rotate` -1 = -32767 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 16 +bitSize -2 = 16 +bitSize -1 = 16 +bitSize 0 = 16 +bitSize 1 = 16 +bitSize 2 = 16 +bitSize 3 = 16 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int32 +-------------------------------- +testBounded +(2147483647,-2147483648,-2147483647) +(2147483646,2147483647,-2147483648) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-2147483648,0,2147483647] +Int : [-2147483648,0,2147483647] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [-2147483648,0,2147483647] +Int64 : [-2147483648,0,2147483647] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [2147483648,0,2147483647] +Word64 : [18446744071562067968,0,2147483647] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = 0 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = 0 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = 0 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -1073741825 +-3 `rotate` -2 = 2147483647 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 +-3 `rotate` -64 = -3 +-3 `rotate` -32 = -3 +-3 `rotate` 32 = -3 +-3 `rotate` 64 = -3 + +-2 `rotate` -3 = -536870913 +-2 `rotate` -2 = -1073741825 +-2 `rotate` -1 = 2147483647 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 +-2 `rotate` -64 = -2 +-2 `rotate` -32 = -2 +-2 `rotate` 32 = -2 +-2 `rotate` 64 = -2 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -1 +-1 `rotate` 64 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 536870912 +1 `rotate` -2 = 1073741824 +1 `rotate` -1 = -2147483648 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 1073741824 +2 `rotate` -2 = -2147483648 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 1610612736 +3 `rotate` -2 = -1073741824 +3 `rotate` -1 = -2147483647 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -3 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -2 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -1 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -3 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -2 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -1 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = False +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = False +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = False +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 32 +bitSize -2 = 32 +bitSize -1 = 32 +bitSize 0 = 32 +bitSize 1 = 32 +bitSize 2 = 32 +bitSize 3 = 32 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Int64 +-------------------------------- +testBounded +(9223372036854775807,-9223372036854775808,-9223372036854775807) +(9223372036854775806,9223372036854775807,-9223372036854775808) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [-9223372036854775808,0,9223372036854775807] +Int : [-9223372036854775808,0,9223372036854775807] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [-9223372036854775808,0,9223372036854775807] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [9223372036854775808,0,9223372036854775807] +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = 0 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = 0 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -4611686018427387905 +-3 `rotate` -2 = 9223372036854775807 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -5 +-3 `rotate` 2 = -9 +-3 `rotate` 3 = -17 +-3 `rotate` -64 = -3 +-3 `rotate` -32 = -8589934593 +-3 `rotate` 32 = -8589934593 +-3 `rotate` 64 = -3 + +-2 `rotate` -3 = -2305843009213693953 +-2 `rotate` -2 = -4611686018427387905 +-2 `rotate` -1 = 9223372036854775807 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -3 +-2 `rotate` 2 = -5 +-2 `rotate` 3 = -9 +-2 `rotate` -64 = -2 +-2 `rotate` -32 = -4294967297 +-2 `rotate` 32 = -4294967297 +-2 `rotate` 64 = -2 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -1 +-1 `rotate` 2 = -1 +-1 `rotate` 3 = -1 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -1 +-1 `rotate` 64 = -1 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = -9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 4294967296 +1 `rotate` 32 = 4294967296 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = -9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 8589934592 +2 `rotate` 32 = 8589934592 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = -4611686018427387904 +3 `rotate` -1 = -9223372036854775807 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 12884901888 +3 `rotate` 32 = 12884901888 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -3 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -2 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -1 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -3 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -2 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -1 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = False + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = False + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize -3 = 64 +bitSize -2 = 64 +bitSize -1 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# +-------------------------------- +--Testing Word8 +-------------------------------- +testBounded +(255,0,1) +(254,255,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[253,254,255,0,1,2,3] +[253,254,255,0,1,2,3] +testEq +253 == 253 = True +253 == 254 = False +253 == 255 = False +253 == 0 = False +253 == 1 = False +253 == 2 = False +253 == 3 = False + +254 == 253 = False +254 == 254 = True +254 == 255 = False +254 == 0 = False +254 == 1 = False +254 == 2 = False +254 == 3 = False + +255 == 253 = False +255 == 254 = False +255 == 255 = True +255 == 0 = False +255 == 1 = False +255 == 2 = False +255 == 3 = False + +0 == 253 = False +0 == 254 = False +0 == 255 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 253 = False +1 == 254 = False +1 == 255 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 253 = False +2 == 254 = False +2 == 255 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 253 = False +3 == 254 = False +3 == 255 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +253 /= 253 = False +253 /= 254 = True +253 /= 255 = True +253 /= 0 = True +253 /= 1 = True +253 /= 2 = True +253 /= 3 = True + +254 /= 253 = True +254 /= 254 = False +254 /= 255 = True +254 /= 0 = True +254 /= 1 = True +254 /= 2 = True +254 /= 3 = True + +255 /= 253 = True +255 /= 254 = True +255 /= 255 = False +255 /= 0 = True +255 /= 1 = True +255 /= 2 = True +255 /= 3 = True + +0 /= 253 = True +0 /= 254 = True +0 /= 255 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 253 = True +1 /= 254 = True +1 /= 255 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 253 = True +2 /= 254 = True +2 /= 255 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 253 = True +3 /= 254 = True +3 /= 255 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +253 <= 253 = True +253 <= 254 = True +253 <= 255 = True +253 <= 0 = False +253 <= 1 = False +253 <= 2 = False +253 <= 3 = False + +254 <= 253 = False +254 <= 254 = True +254 <= 255 = True +254 <= 0 = False +254 <= 1 = False +254 <= 2 = False +254 <= 3 = False + +255 <= 253 = False +255 <= 254 = False +255 <= 255 = True +255 <= 0 = False +255 <= 1 = False +255 <= 2 = False +255 <= 3 = False + +0 <= 253 = True +0 <= 254 = True +0 <= 255 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 253 = True +1 <= 254 = True +1 <= 255 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 253 = True +2 <= 254 = True +2 <= 255 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 253 = True +3 <= 254 = True +3 <= 255 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +253 < 253 = False +253 < 254 = True +253 < 255 = True +253 < 0 = False +253 < 1 = False +253 < 2 = False +253 < 3 = False + +254 < 253 = False +254 < 254 = False +254 < 255 = True +254 < 0 = False +254 < 1 = False +254 < 2 = False +254 < 3 = False + +255 < 253 = False +255 < 254 = False +255 < 255 = False +255 < 0 = False +255 < 1 = False +255 < 2 = False +255 < 3 = False + +0 < 253 = True +0 < 254 = True +0 < 255 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 253 = True +1 < 254 = True +1 < 255 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 253 = True +2 < 254 = True +2 < 255 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 253 = True +3 < 254 = True +3 < 255 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +253 > 253 = False +253 > 254 = False +253 > 255 = False +253 > 0 = True +253 > 1 = True +253 > 2 = True +253 > 3 = True + +254 > 253 = True +254 > 254 = False +254 > 255 = False +254 > 0 = True +254 > 1 = True +254 > 2 = True +254 > 3 = True + +255 > 253 = True +255 > 254 = True +255 > 255 = False +255 > 0 = True +255 > 1 = True +255 > 2 = True +255 > 3 = True + +0 > 253 = False +0 > 254 = False +0 > 255 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 253 = False +1 > 254 = False +1 > 255 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 253 = False +2 > 254 = False +2 > 255 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 253 = False +3 > 254 = False +3 > 255 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +253 >= 253 = True +253 >= 254 = False +253 >= 255 = False +253 >= 0 = True +253 >= 1 = True +253 >= 2 = True +253 >= 3 = True + +254 >= 253 = True +254 >= 254 = True +254 >= 255 = False +254 >= 0 = True +254 >= 1 = True +254 >= 2 = True +254 >= 3 = True + +255 >= 253 = True +255 >= 254 = True +255 >= 255 = True +255 >= 0 = True +255 >= 1 = True +255 >= 2 = True +255 >= 3 = True + +0 >= 253 = False +0 >= 254 = False +0 >= 255 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 253 = False +1 >= 254 = False +1 >= 255 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 253 = False +2 >= 254 = False +2 >= 255 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 253 = False +3 >= 254 = False +3 >= 255 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +253 `compare` 253 = EQ +253 `compare` 254 = LT +253 `compare` 255 = LT +253 `compare` 0 = GT +253 `compare` 1 = GT +253 `compare` 2 = GT +253 `compare` 3 = GT + +254 `compare` 253 = GT +254 `compare` 254 = EQ +254 `compare` 255 = LT +254 `compare` 0 = GT +254 `compare` 1 = GT +254 `compare` 2 = GT +254 `compare` 3 = GT + +255 `compare` 253 = GT +255 `compare` 254 = GT +255 `compare` 255 = EQ +255 `compare` 0 = GT +255 `compare` 1 = GT +255 `compare` 2 = GT +255 `compare` 3 = GT + +0 `compare` 253 = LT +0 `compare` 254 = LT +0 `compare` 255 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 253 = LT +1 `compare` 254 = LT +1 `compare` 255 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 253 = LT +2 `compare` 254 = LT +2 `compare` 255 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 253 = LT +3 `compare` 254 = LT +3 `compare` 255 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +253 + 253 = 250 +253 + 254 = 251 +253 + 255 = 252 +253 + 0 = 253 +253 + 1 = 254 +253 + 2 = 255 +253 + 3 = 0 + +254 + 253 = 251 +254 + 254 = 252 +254 + 255 = 253 +254 + 0 = 254 +254 + 1 = 255 +254 + 2 = 0 +254 + 3 = 1 + +255 + 253 = 252 +255 + 254 = 253 +255 + 255 = 254 +255 + 0 = 255 +255 + 1 = 0 +255 + 2 = 1 +255 + 3 = 2 + +0 + 253 = 253 +0 + 254 = 254 +0 + 255 = 255 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 253 = 254 +1 + 254 = 255 +1 + 255 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 253 = 255 +2 + 254 = 0 +2 + 255 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 253 = 0 +3 + 254 = 1 +3 + 255 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +253 - 253 = 0 +253 - 254 = 255 +253 - 255 = 254 +253 - 0 = 253 +253 - 1 = 252 +253 - 2 = 251 +253 - 3 = 250 + +254 - 253 = 1 +254 - 254 = 0 +254 - 255 = 255 +254 - 0 = 254 +254 - 1 = 253 +254 - 2 = 252 +254 - 3 = 251 + +255 - 253 = 2 +255 - 254 = 1 +255 - 255 = 0 +255 - 0 = 255 +255 - 1 = 254 +255 - 2 = 253 +255 - 3 = 252 + +0 - 253 = 3 +0 - 254 = 2 +0 - 255 = 1 +0 - 0 = 0 +0 - 1 = 255 +0 - 2 = 254 +0 - 3 = 253 + +1 - 253 = 4 +1 - 254 = 3 +1 - 255 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 255 +1 - 3 = 254 + +2 - 253 = 5 +2 - 254 = 4 +2 - 255 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 255 + +3 - 253 = 6 +3 - 254 = 5 +3 - 255 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +253 * 253 = 9 +253 * 254 = 6 +253 * 255 = 3 +253 * 0 = 0 +253 * 1 = 253 +253 * 2 = 250 +253 * 3 = 247 + +254 * 253 = 6 +254 * 254 = 4 +254 * 255 = 2 +254 * 0 = 0 +254 * 1 = 254 +254 * 2 = 252 +254 * 3 = 250 + +255 * 253 = 3 +255 * 254 = 2 +255 * 255 = 1 +255 * 0 = 0 +255 * 1 = 255 +255 * 2 = 254 +255 * 3 = 253 + +0 * 253 = 0 +0 * 254 = 0 +0 * 255 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 253 = 253 +1 * 254 = 254 +1 * 255 = 255 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 253 = 250 +2 * 254 = 252 +2 * 255 = 254 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 253 = 247 +3 * 254 = 250 +3 * 255 = 253 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 253 = 3 +negate 254 = 2 +negate 255 = 1 +negate 0 = 0 +negate 1 = 255 +negate 2 = 254 +negate 3 = 253 +# +testReal +toRational 253 = 253 % 1 +toRational 254 = 254 % 1 +toRational 255 = 255 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +253 `divMod` 253 = (1,0) +253 `divMod` 254 = (0,253) +253 `divMod` 255 = (0,253) +253 `divMod` 0 = divide by zero +253 `divMod` 1 = (253,0) +253 `divMod` 2 = (126,1) +253 `divMod` 3 = (84,1) + +254 `divMod` 253 = (1,1) +254 `divMod` 254 = (1,0) +254 `divMod` 255 = (0,254) +254 `divMod` 0 = divide by zero +254 `divMod` 1 = (254,0) +254 `divMod` 2 = (127,0) +254 `divMod` 3 = (84,2) + +255 `divMod` 253 = (1,2) +255 `divMod` 254 = (1,1) +255 `divMod` 255 = (1,0) +255 `divMod` 0 = divide by zero +255 `divMod` 1 = (255,0) +255 `divMod` 2 = (127,1) +255 `divMod` 3 = (85,0) + +0 `divMod` 253 = (0,0) +0 `divMod` 254 = (0,0) +0 `divMod` 255 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 253 = (0,1) +1 `divMod` 254 = (0,1) +1 `divMod` 255 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 253 = (0,2) +2 `divMod` 254 = (0,2) +2 `divMod` 255 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 253 = (0,3) +3 `divMod` 254 = (0,3) +3 `divMod` 255 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +253 `div` 253 = 1 +253 `div` 254 = 0 +253 `div` 255 = 0 +253 `div` 0 = divide by zero +253 `div` 1 = 253 +253 `div` 2 = 126 +253 `div` 3 = 84 + +254 `div` 253 = 1 +254 `div` 254 = 1 +254 `div` 255 = 0 +254 `div` 0 = divide by zero +254 `div` 1 = 254 +254 `div` 2 = 127 +254 `div` 3 = 84 + +255 `div` 253 = 1 +255 `div` 254 = 1 +255 `div` 255 = 1 +255 `div` 0 = divide by zero +255 `div` 1 = 255 +255 `div` 2 = 127 +255 `div` 3 = 85 + +0 `div` 253 = 0 +0 `div` 254 = 0 +0 `div` 255 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 253 = 0 +1 `div` 254 = 0 +1 `div` 255 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 253 = 0 +2 `div` 254 = 0 +2 `div` 255 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 253 = 0 +3 `div` 254 = 0 +3 `div` 255 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +253 `mod` 253 = 0 +253 `mod` 254 = 253 +253 `mod` 255 = 253 +253 `mod` 0 = divide by zero +253 `mod` 1 = 0 +253 `mod` 2 = 1 +253 `mod` 3 = 1 + +254 `mod` 253 = 1 +254 `mod` 254 = 0 +254 `mod` 255 = 254 +254 `mod` 0 = divide by zero +254 `mod` 1 = 0 +254 `mod` 2 = 0 +254 `mod` 3 = 2 + +255 `mod` 253 = 2 +255 `mod` 254 = 1 +255 `mod` 255 = 0 +255 `mod` 0 = divide by zero +255 `mod` 1 = 0 +255 `mod` 2 = 1 +255 `mod` 3 = 0 + +0 `mod` 253 = 0 +0 `mod` 254 = 0 +0 `mod` 255 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 253 = 1 +1 `mod` 254 = 1 +1 `mod` 255 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 253 = 2 +2 `mod` 254 = 2 +2 `mod` 255 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 253 = 3 +3 `mod` 254 = 3 +3 `mod` 255 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +253 `quotRem` 253 = (1,0) +253 `quotRem` 254 = (0,253) +253 `quotRem` 255 = (0,253) +253 `quotRem` 0 = divide by zero +253 `quotRem` 1 = (253,0) +253 `quotRem` 2 = (126,1) +253 `quotRem` 3 = (84,1) + +254 `quotRem` 253 = (1,1) +254 `quotRem` 254 = (1,0) +254 `quotRem` 255 = (0,254) +254 `quotRem` 0 = divide by zero +254 `quotRem` 1 = (254,0) +254 `quotRem` 2 = (127,0) +254 `quotRem` 3 = (84,2) + +255 `quotRem` 253 = (1,2) +255 `quotRem` 254 = (1,1) +255 `quotRem` 255 = (1,0) +255 `quotRem` 0 = divide by zero +255 `quotRem` 1 = (255,0) +255 `quotRem` 2 = (127,1) +255 `quotRem` 3 = (85,0) + +0 `quotRem` 253 = (0,0) +0 `quotRem` 254 = (0,0) +0 `quotRem` 255 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 253 = (0,1) +1 `quotRem` 254 = (0,1) +1 `quotRem` 255 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 253 = (0,2) +2 `quotRem` 254 = (0,2) +2 `quotRem` 255 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 253 = (0,3) +3 `quotRem` 254 = (0,3) +3 `quotRem` 255 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +253 `quot` 253 = 1 +253 `quot` 254 = 0 +253 `quot` 255 = 0 +253 `quot` 0 = divide by zero +253 `quot` 1 = 253 +253 `quot` 2 = 126 +253 `quot` 3 = 84 + +254 `quot` 253 = 1 +254 `quot` 254 = 1 +254 `quot` 255 = 0 +254 `quot` 0 = divide by zero +254 `quot` 1 = 254 +254 `quot` 2 = 127 +254 `quot` 3 = 84 + +255 `quot` 253 = 1 +255 `quot` 254 = 1 +255 `quot` 255 = 1 +255 `quot` 0 = divide by zero +255 `quot` 1 = 255 +255 `quot` 2 = 127 +255 `quot` 3 = 85 + +0 `quot` 253 = 0 +0 `quot` 254 = 0 +0 `quot` 255 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 253 = 0 +1 `quot` 254 = 0 +1 `quot` 255 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 253 = 0 +2 `quot` 254 = 0 +2 `quot` 255 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 253 = 0 +3 `quot` 254 = 0 +3 `quot` 255 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +253 `rem` 253 = 0 +253 `rem` 254 = 253 +253 `rem` 255 = 253 +253 `rem` 0 = divide by zero +253 `rem` 1 = 0 +253 `rem` 2 = 1 +253 `rem` 3 = 1 + +254 `rem` 253 = 1 +254 `rem` 254 = 0 +254 `rem` 255 = 254 +254 `rem` 0 = divide by zero +254 `rem` 1 = 0 +254 `rem` 2 = 0 +254 `rem` 3 = 2 + +255 `rem` 253 = 2 +255 `rem` 254 = 1 +255 `rem` 255 = 0 +255 `rem` 0 = divide by zero +255 `rem` 1 = 0 +255 `rem` 2 = 1 +255 `rem` 3 = 0 + +0 `rem` 253 = 0 +0 `rem` 254 = 0 +0 `rem` 255 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 253 = 1 +1 `rem` 254 = 1 +1 `rem` 255 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 253 = 2 +2 `rem` 254 = 2 +2 `rem` 255 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 253 = 3 +3 `rem` 254 = 3 +3 `rem` 255 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,255] +Int : [0,0,255] +Int8 : [0,0,-1] +Int16 : [0,0,255] +Int32 : [0,0,255] +Int64 : [0,0,255] +Word8 : [0,0,255] +Word16 : [0,0,255] +Word32 : [0,0,255] +Word64 : [0,0,255] +testBits +253 .&. 253 = 253 +253 .&. 254 = 252 +253 .&. 255 = 253 +253 .&. 0 = 0 +253 .&. 1 = 1 +253 .&. 2 = 0 +253 .&. 3 = 1 + +254 .&. 253 = 252 +254 .&. 254 = 254 +254 .&. 255 = 254 +254 .&. 0 = 0 +254 .&. 1 = 0 +254 .&. 2 = 2 +254 .&. 3 = 2 + +255 .&. 253 = 253 +255 .&. 254 = 254 +255 .&. 255 = 255 +255 .&. 0 = 0 +255 .&. 1 = 1 +255 .&. 2 = 2 +255 .&. 3 = 3 + +0 .&. 253 = 0 +0 .&. 254 = 0 +0 .&. 255 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 253 = 1 +1 .&. 254 = 0 +1 .&. 255 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 253 = 0 +2 .&. 254 = 2 +2 .&. 255 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 253 = 1 +3 .&. 254 = 2 +3 .&. 255 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +253 .|. 253 = 253 +253 .|. 254 = 255 +253 .|. 255 = 255 +253 .|. 0 = 253 +253 .|. 1 = 253 +253 .|. 2 = 255 +253 .|. 3 = 255 + +254 .|. 253 = 255 +254 .|. 254 = 254 +254 .|. 255 = 255 +254 .|. 0 = 254 +254 .|. 1 = 255 +254 .|. 2 = 254 +254 .|. 3 = 255 + +255 .|. 253 = 255 +255 .|. 254 = 255 +255 .|. 255 = 255 +255 .|. 0 = 255 +255 .|. 1 = 255 +255 .|. 2 = 255 +255 .|. 3 = 255 + +0 .|. 253 = 253 +0 .|. 254 = 254 +0 .|. 255 = 255 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 253 = 253 +1 .|. 254 = 255 +1 .|. 255 = 255 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 253 = 255 +2 .|. 254 = 254 +2 .|. 255 = 255 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 253 = 255 +3 .|. 254 = 255 +3 .|. 255 = 255 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +253 `xor` 253 = 0 +253 `xor` 254 = 3 +253 `xor` 255 = 2 +253 `xor` 0 = 253 +253 `xor` 1 = 252 +253 `xor` 2 = 255 +253 `xor` 3 = 254 + +254 `xor` 253 = 3 +254 `xor` 254 = 0 +254 `xor` 255 = 1 +254 `xor` 0 = 254 +254 `xor` 1 = 255 +254 `xor` 2 = 252 +254 `xor` 3 = 253 + +255 `xor` 253 = 2 +255 `xor` 254 = 1 +255 `xor` 255 = 0 +255 `xor` 0 = 255 +255 `xor` 1 = 254 +255 `xor` 2 = 253 +255 `xor` 3 = 252 + +0 `xor` 253 = 253 +0 `xor` 254 = 254 +0 `xor` 255 = 255 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 253 = 252 +1 `xor` 254 = 255 +1 `xor` 255 = 254 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 253 = 255 +2 `xor` 254 = 252 +2 `xor` 255 = 253 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 253 = 254 +3 `xor` 254 = 253 +3 `xor` 255 = 252 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 253 = 2 +complement 254 = 1 +complement 255 = 0 +complement 0 = 255 +complement 1 = 254 +complement 2 = 253 +complement 3 = 252 +# +253 `shiftL` 0 = 253 +253 `shiftL` 1 = 250 +253 `shiftL` 2 = 244 +253 `shiftL` 3 = 232 +253 `shiftL` 32 = 0 +253 `shiftL` 64 = 0 + +254 `shiftL` 0 = 254 +254 `shiftL` 1 = 252 +254 `shiftL` 2 = 248 +254 `shiftL` 3 = 240 +254 `shiftL` 32 = 0 +254 `shiftL` 64 = 0 + +255 `shiftL` 0 = 255 +255 `shiftL` 1 = 254 +255 `shiftL` 2 = 252 +255 `shiftL` 3 = 248 +255 `shiftL` 32 = 0 +255 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +253 `shiftR` 0 = 253 +253 `shiftR` 1 = 126 +253 `shiftR` 2 = 63 +253 `shiftR` 3 = 31 +253 `shiftR` 32 = 0 +253 `shiftR` 64 = 0 + +254 `shiftR` 0 = 254 +254 `shiftR` 1 = 127 +254 `shiftR` 2 = 63 +254 `shiftR` 3 = 31 +254 `shiftR` 32 = 0 +254 `shiftR` 64 = 0 + +255 `shiftR` 0 = 255 +255 `shiftR` 1 = 127 +255 `shiftR` 2 = 63 +255 `shiftR` 3 = 31 +255 `shiftR` 32 = 0 +255 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +253 `rotate` -3 = 191 +253 `rotate` -2 = 127 +253 `rotate` -1 = 254 +253 `rotate` 0 = 253 +253 `rotate` 1 = 251 +253 `rotate` 2 = 247 +253 `rotate` 3 = 239 +253 `rotate` -64 = 253 +253 `rotate` -32 = 253 +253 `rotate` 32 = 253 +253 `rotate` 64 = 253 + +254 `rotate` -3 = 223 +254 `rotate` -2 = 191 +254 `rotate` -1 = 127 +254 `rotate` 0 = 254 +254 `rotate` 1 = 253 +254 `rotate` 2 = 251 +254 `rotate` 3 = 247 +254 `rotate` -64 = 254 +254 `rotate` -32 = 254 +254 `rotate` 32 = 254 +254 `rotate` 64 = 254 + +255 `rotate` -3 = 255 +255 `rotate` -2 = 255 +255 `rotate` -1 = 255 +255 `rotate` 0 = 255 +255 `rotate` 1 = 255 +255 `rotate` 2 = 255 +255 `rotate` 3 = 255 +255 `rotate` -64 = 255 +255 `rotate` -32 = 255 +255 `rotate` 32 = 255 +255 `rotate` 64 = 255 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 32 +1 `rotate` -2 = 64 +1 `rotate` -1 = 128 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 64 +2 `rotate` -2 = 128 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 96 +3 `rotate` -2 = 192 +3 `rotate` -1 = 129 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +253 `setBit` 0 = 253 +253 `setBit` 1 = 255 +253 `setBit` 2 = 253 +253 `setBit` 3 = 253 +253 `setBit` 32 = 253 +253 `setBit` 64 = 253 + +254 `setBit` 0 = 255 +254 `setBit` 1 = 254 +254 `setBit` 2 = 254 +254 `setBit` 3 = 254 +254 `setBit` 32 = 254 +254 `setBit` 64 = 254 + +255 `setBit` 0 = 255 +255 `setBit` 1 = 255 +255 `setBit` 2 = 255 +255 `setBit` 3 = 255 +255 `setBit` 32 = 255 +255 `setBit` 64 = 255 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +253 `clearBit` 0 = 252 +253 `clearBit` 1 = 253 +253 `clearBit` 2 = 249 +253 `clearBit` 3 = 245 +253 `clearBit` 32 = 253 +253 `clearBit` 64 = 253 + +254 `clearBit` 0 = 254 +254 `clearBit` 1 = 252 +254 `clearBit` 2 = 250 +254 `clearBit` 3 = 246 +254 `clearBit` 32 = 254 +254 `clearBit` 64 = 254 + +255 `clearBit` 0 = 254 +255 `clearBit` 1 = 253 +255 `clearBit` 2 = 251 +255 `clearBit` 3 = 247 +255 `clearBit` 32 = 255 +255 `clearBit` 64 = 255 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +253 `complementBit` 0 = 252 +253 `complementBit` 1 = 255 +253 `complementBit` 2 = 249 +253 `complementBit` 3 = 245 +253 `complementBit` 32 = 253 +253 `complementBit` 64 = 253 + +254 `complementBit` 0 = 255 +254 `complementBit` 1 = 252 +254 `complementBit` 2 = 250 +254 `complementBit` 3 = 246 +254 `complementBit` 32 = 254 +254 `complementBit` 64 = 254 + +255 `complementBit` 0 = 254 +255 `complementBit` 1 = 253 +255 `complementBit` 2 = 251 +255 `complementBit` 3 = 247 +255 `complementBit` 32 = 255 +255 `complementBit` 64 = 255 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +253 `testBit` 0 = True +253 `testBit` 1 = False +253 `testBit` 2 = True +253 `testBit` 3 = True +253 `testBit` 32 = False +253 `testBit` 64 = False + +254 `testBit` 0 = False +254 `testBit` 1 = True +254 `testBit` 2 = True +254 `testBit` 3 = True +254 `testBit` 32 = False +254 `testBit` 64 = False + +255 `testBit` 0 = True +255 `testBit` 1 = True +255 `testBit` 2 = True +255 `testBit` 3 = True +255 `testBit` 32 = False +255 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 253 = 8 +bitSize 254 = 8 +bitSize 255 = 8 +bitSize 0 = 8 +bitSize 1 = 8 +bitSize 2 = 8 +bitSize 3 = 8 +# +isSigned 253 = False +isSigned 254 = False +isSigned 255 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word16 +-------------------------------- +testBounded +(65535,0,1) +(65534,65535,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[65533,65534,65535,0,1,2,3] +[65533,65534,65535,0,1,2,3] +testEq +65533 == 65533 = True +65533 == 65534 = False +65533 == 65535 = False +65533 == 0 = False +65533 == 1 = False +65533 == 2 = False +65533 == 3 = False + +65534 == 65533 = False +65534 == 65534 = True +65534 == 65535 = False +65534 == 0 = False +65534 == 1 = False +65534 == 2 = False +65534 == 3 = False + +65535 == 65533 = False +65535 == 65534 = False +65535 == 65535 = True +65535 == 0 = False +65535 == 1 = False +65535 == 2 = False +65535 == 3 = False + +0 == 65533 = False +0 == 65534 = False +0 == 65535 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 65533 = False +1 == 65534 = False +1 == 65535 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 65533 = False +2 == 65534 = False +2 == 65535 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 65533 = False +3 == 65534 = False +3 == 65535 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +65533 /= 65533 = False +65533 /= 65534 = True +65533 /= 65535 = True +65533 /= 0 = True +65533 /= 1 = True +65533 /= 2 = True +65533 /= 3 = True + +65534 /= 65533 = True +65534 /= 65534 = False +65534 /= 65535 = True +65534 /= 0 = True +65534 /= 1 = True +65534 /= 2 = True +65534 /= 3 = True + +65535 /= 65533 = True +65535 /= 65534 = True +65535 /= 65535 = False +65535 /= 0 = True +65535 /= 1 = True +65535 /= 2 = True +65535 /= 3 = True + +0 /= 65533 = True +0 /= 65534 = True +0 /= 65535 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 65533 = True +1 /= 65534 = True +1 /= 65535 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 65533 = True +2 /= 65534 = True +2 /= 65535 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 65533 = True +3 /= 65534 = True +3 /= 65535 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +65533 <= 65533 = True +65533 <= 65534 = True +65533 <= 65535 = True +65533 <= 0 = False +65533 <= 1 = False +65533 <= 2 = False +65533 <= 3 = False + +65534 <= 65533 = False +65534 <= 65534 = True +65534 <= 65535 = True +65534 <= 0 = False +65534 <= 1 = False +65534 <= 2 = False +65534 <= 3 = False + +65535 <= 65533 = False +65535 <= 65534 = False +65535 <= 65535 = True +65535 <= 0 = False +65535 <= 1 = False +65535 <= 2 = False +65535 <= 3 = False + +0 <= 65533 = True +0 <= 65534 = True +0 <= 65535 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 65533 = True +1 <= 65534 = True +1 <= 65535 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 65533 = True +2 <= 65534 = True +2 <= 65535 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 65533 = True +3 <= 65534 = True +3 <= 65535 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +65533 < 65533 = False +65533 < 65534 = True +65533 < 65535 = True +65533 < 0 = False +65533 < 1 = False +65533 < 2 = False +65533 < 3 = False + +65534 < 65533 = False +65534 < 65534 = False +65534 < 65535 = True +65534 < 0 = False +65534 < 1 = False +65534 < 2 = False +65534 < 3 = False + +65535 < 65533 = False +65535 < 65534 = False +65535 < 65535 = False +65535 < 0 = False +65535 < 1 = False +65535 < 2 = False +65535 < 3 = False + +0 < 65533 = True +0 < 65534 = True +0 < 65535 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 65533 = True +1 < 65534 = True +1 < 65535 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 65533 = True +2 < 65534 = True +2 < 65535 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 65533 = True +3 < 65534 = True +3 < 65535 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +65533 > 65533 = False +65533 > 65534 = False +65533 > 65535 = False +65533 > 0 = True +65533 > 1 = True +65533 > 2 = True +65533 > 3 = True + +65534 > 65533 = True +65534 > 65534 = False +65534 > 65535 = False +65534 > 0 = True +65534 > 1 = True +65534 > 2 = True +65534 > 3 = True + +65535 > 65533 = True +65535 > 65534 = True +65535 > 65535 = False +65535 > 0 = True +65535 > 1 = True +65535 > 2 = True +65535 > 3 = True + +0 > 65533 = False +0 > 65534 = False +0 > 65535 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 65533 = False +1 > 65534 = False +1 > 65535 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 65533 = False +2 > 65534 = False +2 > 65535 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 65533 = False +3 > 65534 = False +3 > 65535 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +65533 >= 65533 = True +65533 >= 65534 = False +65533 >= 65535 = False +65533 >= 0 = True +65533 >= 1 = True +65533 >= 2 = True +65533 >= 3 = True + +65534 >= 65533 = True +65534 >= 65534 = True +65534 >= 65535 = False +65534 >= 0 = True +65534 >= 1 = True +65534 >= 2 = True +65534 >= 3 = True + +65535 >= 65533 = True +65535 >= 65534 = True +65535 >= 65535 = True +65535 >= 0 = True +65535 >= 1 = True +65535 >= 2 = True +65535 >= 3 = True + +0 >= 65533 = False +0 >= 65534 = False +0 >= 65535 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 65533 = False +1 >= 65534 = False +1 >= 65535 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 65533 = False +2 >= 65534 = False +2 >= 65535 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 65533 = False +3 >= 65534 = False +3 >= 65535 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +65533 `compare` 65533 = EQ +65533 `compare` 65534 = LT +65533 `compare` 65535 = LT +65533 `compare` 0 = GT +65533 `compare` 1 = GT +65533 `compare` 2 = GT +65533 `compare` 3 = GT + +65534 `compare` 65533 = GT +65534 `compare` 65534 = EQ +65534 `compare` 65535 = LT +65534 `compare` 0 = GT +65534 `compare` 1 = GT +65534 `compare` 2 = GT +65534 `compare` 3 = GT + +65535 `compare` 65533 = GT +65535 `compare` 65534 = GT +65535 `compare` 65535 = EQ +65535 `compare` 0 = GT +65535 `compare` 1 = GT +65535 `compare` 2 = GT +65535 `compare` 3 = GT + +0 `compare` 65533 = LT +0 `compare` 65534 = LT +0 `compare` 65535 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 65533 = LT +1 `compare` 65534 = LT +1 `compare` 65535 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 65533 = LT +2 `compare` 65534 = LT +2 `compare` 65535 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 65533 = LT +3 `compare` 65534 = LT +3 `compare` 65535 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +65533 + 65533 = 65530 +65533 + 65534 = 65531 +65533 + 65535 = 65532 +65533 + 0 = 65533 +65533 + 1 = 65534 +65533 + 2 = 65535 +65533 + 3 = 0 + +65534 + 65533 = 65531 +65534 + 65534 = 65532 +65534 + 65535 = 65533 +65534 + 0 = 65534 +65534 + 1 = 65535 +65534 + 2 = 0 +65534 + 3 = 1 + +65535 + 65533 = 65532 +65535 + 65534 = 65533 +65535 + 65535 = 65534 +65535 + 0 = 65535 +65535 + 1 = 0 +65535 + 2 = 1 +65535 + 3 = 2 + +0 + 65533 = 65533 +0 + 65534 = 65534 +0 + 65535 = 65535 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 65533 = 65534 +1 + 65534 = 65535 +1 + 65535 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 65533 = 65535 +2 + 65534 = 0 +2 + 65535 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 65533 = 0 +3 + 65534 = 1 +3 + 65535 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +65533 - 65533 = 0 +65533 - 65534 = 65535 +65533 - 65535 = 65534 +65533 - 0 = 65533 +65533 - 1 = 65532 +65533 - 2 = 65531 +65533 - 3 = 65530 + +65534 - 65533 = 1 +65534 - 65534 = 0 +65534 - 65535 = 65535 +65534 - 0 = 65534 +65534 - 1 = 65533 +65534 - 2 = 65532 +65534 - 3 = 65531 + +65535 - 65533 = 2 +65535 - 65534 = 1 +65535 - 65535 = 0 +65535 - 0 = 65535 +65535 - 1 = 65534 +65535 - 2 = 65533 +65535 - 3 = 65532 + +0 - 65533 = 3 +0 - 65534 = 2 +0 - 65535 = 1 +0 - 0 = 0 +0 - 1 = 65535 +0 - 2 = 65534 +0 - 3 = 65533 + +1 - 65533 = 4 +1 - 65534 = 3 +1 - 65535 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 65535 +1 - 3 = 65534 + +2 - 65533 = 5 +2 - 65534 = 4 +2 - 65535 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 65535 + +3 - 65533 = 6 +3 - 65534 = 5 +3 - 65535 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +65533 * 65533 = 9 +65533 * 65534 = 6 +65533 * 65535 = 3 +65533 * 0 = 0 +65533 * 1 = 65533 +65533 * 2 = 65530 +65533 * 3 = 65527 + +65534 * 65533 = 6 +65534 * 65534 = 4 +65534 * 65535 = 2 +65534 * 0 = 0 +65534 * 1 = 65534 +65534 * 2 = 65532 +65534 * 3 = 65530 + +65535 * 65533 = 3 +65535 * 65534 = 2 +65535 * 65535 = 1 +65535 * 0 = 0 +65535 * 1 = 65535 +65535 * 2 = 65534 +65535 * 3 = 65533 + +0 * 65533 = 0 +0 * 65534 = 0 +0 * 65535 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 65533 = 65533 +1 * 65534 = 65534 +1 * 65535 = 65535 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 65533 = 65530 +2 * 65534 = 65532 +2 * 65535 = 65534 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 65533 = 65527 +3 * 65534 = 65530 +3 * 65535 = 65533 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 65533 = 3 +negate 65534 = 2 +negate 65535 = 1 +negate 0 = 0 +negate 1 = 65535 +negate 2 = 65534 +negate 3 = 65533 +# +testReal +toRational 65533 = 65533 % 1 +toRational 65534 = 65534 % 1 +toRational 65535 = 65535 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +65533 `divMod` 65533 = (1,0) +65533 `divMod` 65534 = (0,65533) +65533 `divMod` 65535 = (0,65533) +65533 `divMod` 0 = divide by zero +65533 `divMod` 1 = (65533,0) +65533 `divMod` 2 = (32766,1) +65533 `divMod` 3 = (21844,1) + +65534 `divMod` 65533 = (1,1) +65534 `divMod` 65534 = (1,0) +65534 `divMod` 65535 = (0,65534) +65534 `divMod` 0 = divide by zero +65534 `divMod` 1 = (65534,0) +65534 `divMod` 2 = (32767,0) +65534 `divMod` 3 = (21844,2) + +65535 `divMod` 65533 = (1,2) +65535 `divMod` 65534 = (1,1) +65535 `divMod` 65535 = (1,0) +65535 `divMod` 0 = divide by zero +65535 `divMod` 1 = (65535,0) +65535 `divMod` 2 = (32767,1) +65535 `divMod` 3 = (21845,0) + +0 `divMod` 65533 = (0,0) +0 `divMod` 65534 = (0,0) +0 `divMod` 65535 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 65533 = (0,1) +1 `divMod` 65534 = (0,1) +1 `divMod` 65535 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 65533 = (0,2) +2 `divMod` 65534 = (0,2) +2 `divMod` 65535 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 65533 = (0,3) +3 `divMod` 65534 = (0,3) +3 `divMod` 65535 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +65533 `div` 65533 = 1 +65533 `div` 65534 = 0 +65533 `div` 65535 = 0 +65533 `div` 0 = divide by zero +65533 `div` 1 = 65533 +65533 `div` 2 = 32766 +65533 `div` 3 = 21844 + +65534 `div` 65533 = 1 +65534 `div` 65534 = 1 +65534 `div` 65535 = 0 +65534 `div` 0 = divide by zero +65534 `div` 1 = 65534 +65534 `div` 2 = 32767 +65534 `div` 3 = 21844 + +65535 `div` 65533 = 1 +65535 `div` 65534 = 1 +65535 `div` 65535 = 1 +65535 `div` 0 = divide by zero +65535 `div` 1 = 65535 +65535 `div` 2 = 32767 +65535 `div` 3 = 21845 + +0 `div` 65533 = 0 +0 `div` 65534 = 0 +0 `div` 65535 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 65533 = 0 +1 `div` 65534 = 0 +1 `div` 65535 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 65533 = 0 +2 `div` 65534 = 0 +2 `div` 65535 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 65533 = 0 +3 `div` 65534 = 0 +3 `div` 65535 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +65533 `mod` 65533 = 0 +65533 `mod` 65534 = 65533 +65533 `mod` 65535 = 65533 +65533 `mod` 0 = divide by zero +65533 `mod` 1 = 0 +65533 `mod` 2 = 1 +65533 `mod` 3 = 1 + +65534 `mod` 65533 = 1 +65534 `mod` 65534 = 0 +65534 `mod` 65535 = 65534 +65534 `mod` 0 = divide by zero +65534 `mod` 1 = 0 +65534 `mod` 2 = 0 +65534 `mod` 3 = 2 + +65535 `mod` 65533 = 2 +65535 `mod` 65534 = 1 +65535 `mod` 65535 = 0 +65535 `mod` 0 = divide by zero +65535 `mod` 1 = 0 +65535 `mod` 2 = 1 +65535 `mod` 3 = 0 + +0 `mod` 65533 = 0 +0 `mod` 65534 = 0 +0 `mod` 65535 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 65533 = 1 +1 `mod` 65534 = 1 +1 `mod` 65535 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 65533 = 2 +2 `mod` 65534 = 2 +2 `mod` 65535 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 65533 = 3 +3 `mod` 65534 = 3 +3 `mod` 65535 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +65533 `quotRem` 65533 = (1,0) +65533 `quotRem` 65534 = (0,65533) +65533 `quotRem` 65535 = (0,65533) +65533 `quotRem` 0 = divide by zero +65533 `quotRem` 1 = (65533,0) +65533 `quotRem` 2 = (32766,1) +65533 `quotRem` 3 = (21844,1) + +65534 `quotRem` 65533 = (1,1) +65534 `quotRem` 65534 = (1,0) +65534 `quotRem` 65535 = (0,65534) +65534 `quotRem` 0 = divide by zero +65534 `quotRem` 1 = (65534,0) +65534 `quotRem` 2 = (32767,0) +65534 `quotRem` 3 = (21844,2) + +65535 `quotRem` 65533 = (1,2) +65535 `quotRem` 65534 = (1,1) +65535 `quotRem` 65535 = (1,0) +65535 `quotRem` 0 = divide by zero +65535 `quotRem` 1 = (65535,0) +65535 `quotRem` 2 = (32767,1) +65535 `quotRem` 3 = (21845,0) + +0 `quotRem` 65533 = (0,0) +0 `quotRem` 65534 = (0,0) +0 `quotRem` 65535 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 65533 = (0,1) +1 `quotRem` 65534 = (0,1) +1 `quotRem` 65535 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 65533 = (0,2) +2 `quotRem` 65534 = (0,2) +2 `quotRem` 65535 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 65533 = (0,3) +3 `quotRem` 65534 = (0,3) +3 `quotRem` 65535 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +65533 `quot` 65533 = 1 +65533 `quot` 65534 = 0 +65533 `quot` 65535 = 0 +65533 `quot` 0 = divide by zero +65533 `quot` 1 = 65533 +65533 `quot` 2 = 32766 +65533 `quot` 3 = 21844 + +65534 `quot` 65533 = 1 +65534 `quot` 65534 = 1 +65534 `quot` 65535 = 0 +65534 `quot` 0 = divide by zero +65534 `quot` 1 = 65534 +65534 `quot` 2 = 32767 +65534 `quot` 3 = 21844 + +65535 `quot` 65533 = 1 +65535 `quot` 65534 = 1 +65535 `quot` 65535 = 1 +65535 `quot` 0 = divide by zero +65535 `quot` 1 = 65535 +65535 `quot` 2 = 32767 +65535 `quot` 3 = 21845 + +0 `quot` 65533 = 0 +0 `quot` 65534 = 0 +0 `quot` 65535 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 65533 = 0 +1 `quot` 65534 = 0 +1 `quot` 65535 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 65533 = 0 +2 `quot` 65534 = 0 +2 `quot` 65535 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 65533 = 0 +3 `quot` 65534 = 0 +3 `quot` 65535 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +65533 `rem` 65533 = 0 +65533 `rem` 65534 = 65533 +65533 `rem` 65535 = 65533 +65533 `rem` 0 = divide by zero +65533 `rem` 1 = 0 +65533 `rem` 2 = 1 +65533 `rem` 3 = 1 + +65534 `rem` 65533 = 1 +65534 `rem` 65534 = 0 +65534 `rem` 65535 = 65534 +65534 `rem` 0 = divide by zero +65534 `rem` 1 = 0 +65534 `rem` 2 = 0 +65534 `rem` 3 = 2 + +65535 `rem` 65533 = 2 +65535 `rem` 65534 = 1 +65535 `rem` 65535 = 0 +65535 `rem` 0 = divide by zero +65535 `rem` 1 = 0 +65535 `rem` 2 = 1 +65535 `rem` 3 = 0 + +0 `rem` 65533 = 0 +0 `rem` 65534 = 0 +0 `rem` 65535 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 65533 = 1 +1 `rem` 65534 = 1 +1 `rem` 65535 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 65533 = 2 +2 `rem` 65534 = 2 +2 `rem` 65535 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 65533 = 3 +3 `rem` 65534 = 3 +3 `rem` 65535 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,65535] +Int : [0,0,65535] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,65535] +Int64 : [0,0,65535] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,65535] +Word64 : [0,0,65535] +testBits +65533 .&. 65533 = 65533 +65533 .&. 65534 = 65532 +65533 .&. 65535 = 65533 +65533 .&. 0 = 0 +65533 .&. 1 = 1 +65533 .&. 2 = 0 +65533 .&. 3 = 1 + +65534 .&. 65533 = 65532 +65534 .&. 65534 = 65534 +65534 .&. 65535 = 65534 +65534 .&. 0 = 0 +65534 .&. 1 = 0 +65534 .&. 2 = 2 +65534 .&. 3 = 2 + +65535 .&. 65533 = 65533 +65535 .&. 65534 = 65534 +65535 .&. 65535 = 65535 +65535 .&. 0 = 0 +65535 .&. 1 = 1 +65535 .&. 2 = 2 +65535 .&. 3 = 3 + +0 .&. 65533 = 0 +0 .&. 65534 = 0 +0 .&. 65535 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 65533 = 1 +1 .&. 65534 = 0 +1 .&. 65535 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 65533 = 0 +2 .&. 65534 = 2 +2 .&. 65535 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 65533 = 1 +3 .&. 65534 = 2 +3 .&. 65535 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +65533 .|. 65533 = 65533 +65533 .|. 65534 = 65535 +65533 .|. 65535 = 65535 +65533 .|. 0 = 65533 +65533 .|. 1 = 65533 +65533 .|. 2 = 65535 +65533 .|. 3 = 65535 + +65534 .|. 65533 = 65535 +65534 .|. 65534 = 65534 +65534 .|. 65535 = 65535 +65534 .|. 0 = 65534 +65534 .|. 1 = 65535 +65534 .|. 2 = 65534 +65534 .|. 3 = 65535 + +65535 .|. 65533 = 65535 +65535 .|. 65534 = 65535 +65535 .|. 65535 = 65535 +65535 .|. 0 = 65535 +65535 .|. 1 = 65535 +65535 .|. 2 = 65535 +65535 .|. 3 = 65535 + +0 .|. 65533 = 65533 +0 .|. 65534 = 65534 +0 .|. 65535 = 65535 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 65533 = 65533 +1 .|. 65534 = 65535 +1 .|. 65535 = 65535 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 65533 = 65535 +2 .|. 65534 = 65534 +2 .|. 65535 = 65535 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 65533 = 65535 +3 .|. 65534 = 65535 +3 .|. 65535 = 65535 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +65533 `xor` 65533 = 0 +65533 `xor` 65534 = 3 +65533 `xor` 65535 = 2 +65533 `xor` 0 = 65533 +65533 `xor` 1 = 65532 +65533 `xor` 2 = 65535 +65533 `xor` 3 = 65534 + +65534 `xor` 65533 = 3 +65534 `xor` 65534 = 0 +65534 `xor` 65535 = 1 +65534 `xor` 0 = 65534 +65534 `xor` 1 = 65535 +65534 `xor` 2 = 65532 +65534 `xor` 3 = 65533 + +65535 `xor` 65533 = 2 +65535 `xor` 65534 = 1 +65535 `xor` 65535 = 0 +65535 `xor` 0 = 65535 +65535 `xor` 1 = 65534 +65535 `xor` 2 = 65533 +65535 `xor` 3 = 65532 + +0 `xor` 65533 = 65533 +0 `xor` 65534 = 65534 +0 `xor` 65535 = 65535 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 65533 = 65532 +1 `xor` 65534 = 65535 +1 `xor` 65535 = 65534 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 65533 = 65535 +2 `xor` 65534 = 65532 +2 `xor` 65535 = 65533 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 65533 = 65534 +3 `xor` 65534 = 65533 +3 `xor` 65535 = 65532 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 65533 = 2 +complement 65534 = 1 +complement 65535 = 0 +complement 0 = 65535 +complement 1 = 65534 +complement 2 = 65533 +complement 3 = 65532 +# +65533 `shiftL` 0 = 65533 +65533 `shiftL` 1 = 65530 +65533 `shiftL` 2 = 65524 +65533 `shiftL` 3 = 65512 +65533 `shiftL` 32 = 0 +65533 `shiftL` 64 = 0 + +65534 `shiftL` 0 = 65534 +65534 `shiftL` 1 = 65532 +65534 `shiftL` 2 = 65528 +65534 `shiftL` 3 = 65520 +65534 `shiftL` 32 = 0 +65534 `shiftL` 64 = 0 + +65535 `shiftL` 0 = 65535 +65535 `shiftL` 1 = 65534 +65535 `shiftL` 2 = 65532 +65535 `shiftL` 3 = 65528 +65535 `shiftL` 32 = 0 +65535 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +65533 `shiftR` 0 = 65533 +65533 `shiftR` 1 = 32766 +65533 `shiftR` 2 = 16383 +65533 `shiftR` 3 = 8191 +65533 `shiftR` 32 = 0 +65533 `shiftR` 64 = 0 + +65534 `shiftR` 0 = 65534 +65534 `shiftR` 1 = 32767 +65534 `shiftR` 2 = 16383 +65534 `shiftR` 3 = 8191 +65534 `shiftR` 32 = 0 +65534 `shiftR` 64 = 0 + +65535 `shiftR` 0 = 65535 +65535 `shiftR` 1 = 32767 +65535 `shiftR` 2 = 16383 +65535 `shiftR` 3 = 8191 +65535 `shiftR` 32 = 0 +65535 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +65533 `rotate` -3 = 49151 +65533 `rotate` -2 = 32767 +65533 `rotate` -1 = 65534 +65533 `rotate` 0 = 65533 +65533 `rotate` 1 = 65531 +65533 `rotate` 2 = 65527 +65533 `rotate` 3 = 65519 +65533 `rotate` -64 = 65533 +65533 `rotate` -32 = 65533 +65533 `rotate` 32 = 65533 +65533 `rotate` 64 = 65533 + +65534 `rotate` -3 = 57343 +65534 `rotate` -2 = 49151 +65534 `rotate` -1 = 32767 +65534 `rotate` 0 = 65534 +65534 `rotate` 1 = 65533 +65534 `rotate` 2 = 65531 +65534 `rotate` 3 = 65527 +65534 `rotate` -64 = 65534 +65534 `rotate` -32 = 65534 +65534 `rotate` 32 = 65534 +65534 `rotate` 64 = 65534 + +65535 `rotate` -3 = 65535 +65535 `rotate` -2 = 65535 +65535 `rotate` -1 = 65535 +65535 `rotate` 0 = 65535 +65535 `rotate` 1 = 65535 +65535 `rotate` 2 = 65535 +65535 `rotate` 3 = 65535 +65535 `rotate` -64 = 65535 +65535 `rotate` -32 = 65535 +65535 `rotate` 32 = 65535 +65535 `rotate` 64 = 65535 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 8192 +1 `rotate` -2 = 16384 +1 `rotate` -1 = 32768 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 16384 +2 `rotate` -2 = 32768 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 24576 +3 `rotate` -2 = 49152 +3 `rotate` -1 = 32769 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +65533 `setBit` 0 = 65533 +65533 `setBit` 1 = 65535 +65533 `setBit` 2 = 65533 +65533 `setBit` 3 = 65533 +65533 `setBit` 32 = 65533 +65533 `setBit` 64 = 65533 + +65534 `setBit` 0 = 65535 +65534 `setBit` 1 = 65534 +65534 `setBit` 2 = 65534 +65534 `setBit` 3 = 65534 +65534 `setBit` 32 = 65534 +65534 `setBit` 64 = 65534 + +65535 `setBit` 0 = 65535 +65535 `setBit` 1 = 65535 +65535 `setBit` 2 = 65535 +65535 `setBit` 3 = 65535 +65535 `setBit` 32 = 65535 +65535 `setBit` 64 = 65535 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +65533 `clearBit` 0 = 65532 +65533 `clearBit` 1 = 65533 +65533 `clearBit` 2 = 65529 +65533 `clearBit` 3 = 65525 +65533 `clearBit` 32 = 65533 +65533 `clearBit` 64 = 65533 + +65534 `clearBit` 0 = 65534 +65534 `clearBit` 1 = 65532 +65534 `clearBit` 2 = 65530 +65534 `clearBit` 3 = 65526 +65534 `clearBit` 32 = 65534 +65534 `clearBit` 64 = 65534 + +65535 `clearBit` 0 = 65534 +65535 `clearBit` 1 = 65533 +65535 `clearBit` 2 = 65531 +65535 `clearBit` 3 = 65527 +65535 `clearBit` 32 = 65535 +65535 `clearBit` 64 = 65535 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +65533 `complementBit` 0 = 65532 +65533 `complementBit` 1 = 65535 +65533 `complementBit` 2 = 65529 +65533 `complementBit` 3 = 65525 +65533 `complementBit` 32 = 65533 +65533 `complementBit` 64 = 65533 + +65534 `complementBit` 0 = 65535 +65534 `complementBit` 1 = 65532 +65534 `complementBit` 2 = 65530 +65534 `complementBit` 3 = 65526 +65534 `complementBit` 32 = 65534 +65534 `complementBit` 64 = 65534 + +65535 `complementBit` 0 = 65534 +65535 `complementBit` 1 = 65533 +65535 `complementBit` 2 = 65531 +65535 `complementBit` 3 = 65527 +65535 `complementBit` 32 = 65535 +65535 `complementBit` 64 = 65535 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +65533 `testBit` 0 = True +65533 `testBit` 1 = False +65533 `testBit` 2 = True +65533 `testBit` 3 = True +65533 `testBit` 32 = False +65533 `testBit` 64 = False + +65534 `testBit` 0 = False +65534 `testBit` 1 = True +65534 `testBit` 2 = True +65534 `testBit` 3 = True +65534 `testBit` 32 = False +65534 `testBit` 64 = False + +65535 `testBit` 0 = True +65535 `testBit` 1 = True +65535 `testBit` 2 = True +65535 `testBit` 3 = True +65535 `testBit` 32 = False +65535 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 65533 = 16 +bitSize 65534 = 16 +bitSize 65535 = 16 +bitSize 0 = 16 +bitSize 1 = 16 +bitSize 2 = 16 +bitSize 3 = 16 +# +isSigned 65533 = False +isSigned 65534 = False +isSigned 65535 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word32 +-------------------------------- +testBounded +(4294967295,0,1) +(4294967294,4294967295,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[4294967293,4294967294,4294967295,0,1,2,3] +[4294967293,4294967294,4294967295,0,1,2,3] +testEq +4294967293 == 4294967293 = True +4294967293 == 4294967294 = False +4294967293 == 4294967295 = False +4294967293 == 0 = False +4294967293 == 1 = False +4294967293 == 2 = False +4294967293 == 3 = False + +4294967294 == 4294967293 = False +4294967294 == 4294967294 = True +4294967294 == 4294967295 = False +4294967294 == 0 = False +4294967294 == 1 = False +4294967294 == 2 = False +4294967294 == 3 = False + +4294967295 == 4294967293 = False +4294967295 == 4294967294 = False +4294967295 == 4294967295 = True +4294967295 == 0 = False +4294967295 == 1 = False +4294967295 == 2 = False +4294967295 == 3 = False + +0 == 4294967293 = False +0 == 4294967294 = False +0 == 4294967295 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 4294967293 = False +1 == 4294967294 = False +1 == 4294967295 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 4294967293 = False +2 == 4294967294 = False +2 == 4294967295 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 4294967293 = False +3 == 4294967294 = False +3 == 4294967295 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +4294967293 /= 4294967293 = False +4294967293 /= 4294967294 = True +4294967293 /= 4294967295 = True +4294967293 /= 0 = True +4294967293 /= 1 = True +4294967293 /= 2 = True +4294967293 /= 3 = True + +4294967294 /= 4294967293 = True +4294967294 /= 4294967294 = False +4294967294 /= 4294967295 = True +4294967294 /= 0 = True +4294967294 /= 1 = True +4294967294 /= 2 = True +4294967294 /= 3 = True + +4294967295 /= 4294967293 = True +4294967295 /= 4294967294 = True +4294967295 /= 4294967295 = False +4294967295 /= 0 = True +4294967295 /= 1 = True +4294967295 /= 2 = True +4294967295 /= 3 = True + +0 /= 4294967293 = True +0 /= 4294967294 = True +0 /= 4294967295 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 4294967293 = True +1 /= 4294967294 = True +1 /= 4294967295 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 4294967293 = True +2 /= 4294967294 = True +2 /= 4294967295 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 4294967293 = True +3 /= 4294967294 = True +3 /= 4294967295 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +4294967293 <= 4294967293 = True +4294967293 <= 4294967294 = True +4294967293 <= 4294967295 = True +4294967293 <= 0 = False +4294967293 <= 1 = False +4294967293 <= 2 = False +4294967293 <= 3 = False + +4294967294 <= 4294967293 = False +4294967294 <= 4294967294 = True +4294967294 <= 4294967295 = True +4294967294 <= 0 = False +4294967294 <= 1 = False +4294967294 <= 2 = False +4294967294 <= 3 = False + +4294967295 <= 4294967293 = False +4294967295 <= 4294967294 = False +4294967295 <= 4294967295 = True +4294967295 <= 0 = False +4294967295 <= 1 = False +4294967295 <= 2 = False +4294967295 <= 3 = False + +0 <= 4294967293 = True +0 <= 4294967294 = True +0 <= 4294967295 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 4294967293 = True +1 <= 4294967294 = True +1 <= 4294967295 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 4294967293 = True +2 <= 4294967294 = True +2 <= 4294967295 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 4294967293 = True +3 <= 4294967294 = True +3 <= 4294967295 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +4294967293 < 4294967293 = False +4294967293 < 4294967294 = True +4294967293 < 4294967295 = True +4294967293 < 0 = False +4294967293 < 1 = False +4294967293 < 2 = False +4294967293 < 3 = False + +4294967294 < 4294967293 = False +4294967294 < 4294967294 = False +4294967294 < 4294967295 = True +4294967294 < 0 = False +4294967294 < 1 = False +4294967294 < 2 = False +4294967294 < 3 = False + +4294967295 < 4294967293 = False +4294967295 < 4294967294 = False +4294967295 < 4294967295 = False +4294967295 < 0 = False +4294967295 < 1 = False +4294967295 < 2 = False +4294967295 < 3 = False + +0 < 4294967293 = True +0 < 4294967294 = True +0 < 4294967295 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 4294967293 = True +1 < 4294967294 = True +1 < 4294967295 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 4294967293 = True +2 < 4294967294 = True +2 < 4294967295 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 4294967293 = True +3 < 4294967294 = True +3 < 4294967295 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +4294967293 > 4294967293 = False +4294967293 > 4294967294 = False +4294967293 > 4294967295 = False +4294967293 > 0 = True +4294967293 > 1 = True +4294967293 > 2 = True +4294967293 > 3 = True + +4294967294 > 4294967293 = True +4294967294 > 4294967294 = False +4294967294 > 4294967295 = False +4294967294 > 0 = True +4294967294 > 1 = True +4294967294 > 2 = True +4294967294 > 3 = True + +4294967295 > 4294967293 = True +4294967295 > 4294967294 = True +4294967295 > 4294967295 = False +4294967295 > 0 = True +4294967295 > 1 = True +4294967295 > 2 = True +4294967295 > 3 = True + +0 > 4294967293 = False +0 > 4294967294 = False +0 > 4294967295 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 4294967293 = False +1 > 4294967294 = False +1 > 4294967295 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 4294967293 = False +2 > 4294967294 = False +2 > 4294967295 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 4294967293 = False +3 > 4294967294 = False +3 > 4294967295 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +4294967293 >= 4294967293 = True +4294967293 >= 4294967294 = False +4294967293 >= 4294967295 = False +4294967293 >= 0 = True +4294967293 >= 1 = True +4294967293 >= 2 = True +4294967293 >= 3 = True + +4294967294 >= 4294967293 = True +4294967294 >= 4294967294 = True +4294967294 >= 4294967295 = False +4294967294 >= 0 = True +4294967294 >= 1 = True +4294967294 >= 2 = True +4294967294 >= 3 = True + +4294967295 >= 4294967293 = True +4294967295 >= 4294967294 = True +4294967295 >= 4294967295 = True +4294967295 >= 0 = True +4294967295 >= 1 = True +4294967295 >= 2 = True +4294967295 >= 3 = True + +0 >= 4294967293 = False +0 >= 4294967294 = False +0 >= 4294967295 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 4294967293 = False +1 >= 4294967294 = False +1 >= 4294967295 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 4294967293 = False +2 >= 4294967294 = False +2 >= 4294967295 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 4294967293 = False +3 >= 4294967294 = False +3 >= 4294967295 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +4294967293 `compare` 4294967293 = EQ +4294967293 `compare` 4294967294 = LT +4294967293 `compare` 4294967295 = LT +4294967293 `compare` 0 = GT +4294967293 `compare` 1 = GT +4294967293 `compare` 2 = GT +4294967293 `compare` 3 = GT + +4294967294 `compare` 4294967293 = GT +4294967294 `compare` 4294967294 = EQ +4294967294 `compare` 4294967295 = LT +4294967294 `compare` 0 = GT +4294967294 `compare` 1 = GT +4294967294 `compare` 2 = GT +4294967294 `compare` 3 = GT + +4294967295 `compare` 4294967293 = GT +4294967295 `compare` 4294967294 = GT +4294967295 `compare` 4294967295 = EQ +4294967295 `compare` 0 = GT +4294967295 `compare` 1 = GT +4294967295 `compare` 2 = GT +4294967295 `compare` 3 = GT + +0 `compare` 4294967293 = LT +0 `compare` 4294967294 = LT +0 `compare` 4294967295 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 4294967293 = LT +1 `compare` 4294967294 = LT +1 `compare` 4294967295 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 4294967293 = LT +2 `compare` 4294967294 = LT +2 `compare` 4294967295 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 4294967293 = LT +3 `compare` 4294967294 = LT +3 `compare` 4294967295 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +4294967293 + 4294967293 = 4294967290 +4294967293 + 4294967294 = 4294967291 +4294967293 + 4294967295 = 4294967292 +4294967293 + 0 = 4294967293 +4294967293 + 1 = 4294967294 +4294967293 + 2 = 4294967295 +4294967293 + 3 = 0 + +4294967294 + 4294967293 = 4294967291 +4294967294 + 4294967294 = 4294967292 +4294967294 + 4294967295 = 4294967293 +4294967294 + 0 = 4294967294 +4294967294 + 1 = 4294967295 +4294967294 + 2 = 0 +4294967294 + 3 = 1 + +4294967295 + 4294967293 = 4294967292 +4294967295 + 4294967294 = 4294967293 +4294967295 + 4294967295 = 4294967294 +4294967295 + 0 = 4294967295 +4294967295 + 1 = 0 +4294967295 + 2 = 1 +4294967295 + 3 = 2 + +0 + 4294967293 = 4294967293 +0 + 4294967294 = 4294967294 +0 + 4294967295 = 4294967295 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 4294967293 = 4294967294 +1 + 4294967294 = 4294967295 +1 + 4294967295 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 4294967293 = 4294967295 +2 + 4294967294 = 0 +2 + 4294967295 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 4294967293 = 0 +3 + 4294967294 = 1 +3 + 4294967295 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +4294967293 - 4294967293 = 0 +4294967293 - 4294967294 = 4294967295 +4294967293 - 4294967295 = 4294967294 +4294967293 - 0 = 4294967293 +4294967293 - 1 = 4294967292 +4294967293 - 2 = 4294967291 +4294967293 - 3 = 4294967290 + +4294967294 - 4294967293 = 1 +4294967294 - 4294967294 = 0 +4294967294 - 4294967295 = 4294967295 +4294967294 - 0 = 4294967294 +4294967294 - 1 = 4294967293 +4294967294 - 2 = 4294967292 +4294967294 - 3 = 4294967291 + +4294967295 - 4294967293 = 2 +4294967295 - 4294967294 = 1 +4294967295 - 4294967295 = 0 +4294967295 - 0 = 4294967295 +4294967295 - 1 = 4294967294 +4294967295 - 2 = 4294967293 +4294967295 - 3 = 4294967292 + +0 - 4294967293 = 3 +0 - 4294967294 = 2 +0 - 4294967295 = 1 +0 - 0 = 0 +0 - 1 = 4294967295 +0 - 2 = 4294967294 +0 - 3 = 4294967293 + +1 - 4294967293 = 4 +1 - 4294967294 = 3 +1 - 4294967295 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 4294967295 +1 - 3 = 4294967294 + +2 - 4294967293 = 5 +2 - 4294967294 = 4 +2 - 4294967295 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 4294967295 + +3 - 4294967293 = 6 +3 - 4294967294 = 5 +3 - 4294967295 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +4294967293 * 4294967293 = 9 +4294967293 * 4294967294 = 6 +4294967293 * 4294967295 = 3 +4294967293 * 0 = 0 +4294967293 * 1 = 4294967293 +4294967293 * 2 = 4294967290 +4294967293 * 3 = 4294967287 + +4294967294 * 4294967293 = 6 +4294967294 * 4294967294 = 4 +4294967294 * 4294967295 = 2 +4294967294 * 0 = 0 +4294967294 * 1 = 4294967294 +4294967294 * 2 = 4294967292 +4294967294 * 3 = 4294967290 + +4294967295 * 4294967293 = 3 +4294967295 * 4294967294 = 2 +4294967295 * 4294967295 = 1 +4294967295 * 0 = 0 +4294967295 * 1 = 4294967295 +4294967295 * 2 = 4294967294 +4294967295 * 3 = 4294967293 + +0 * 4294967293 = 0 +0 * 4294967294 = 0 +0 * 4294967295 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 4294967293 = 4294967293 +1 * 4294967294 = 4294967294 +1 * 4294967295 = 4294967295 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 4294967293 = 4294967290 +2 * 4294967294 = 4294967292 +2 * 4294967295 = 4294967294 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 4294967293 = 4294967287 +3 * 4294967294 = 4294967290 +3 * 4294967295 = 4294967293 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 4294967293 = 3 +negate 4294967294 = 2 +negate 4294967295 = 1 +negate 0 = 0 +negate 1 = 4294967295 +negate 2 = 4294967294 +negate 3 = 4294967293 +# +testReal +toRational 4294967293 = 4294967293 % 1 +toRational 4294967294 = 4294967294 % 1 +toRational 4294967295 = 4294967295 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +4294967293 `divMod` 4294967293 = (1,0) +4294967293 `divMod` 4294967294 = (0,4294967293) +4294967293 `divMod` 4294967295 = (0,4294967293) +4294967293 `divMod` 0 = divide by zero +4294967293 `divMod` 1 = (4294967293,0) +4294967293 `divMod` 2 = (2147483646,1) +4294967293 `divMod` 3 = (1431655764,1) + +4294967294 `divMod` 4294967293 = (1,1) +4294967294 `divMod` 4294967294 = (1,0) +4294967294 `divMod` 4294967295 = (0,4294967294) +4294967294 `divMod` 0 = divide by zero +4294967294 `divMod` 1 = (4294967294,0) +4294967294 `divMod` 2 = (2147483647,0) +4294967294 `divMod` 3 = (1431655764,2) + +4294967295 `divMod` 4294967293 = (1,2) +4294967295 `divMod` 4294967294 = (1,1) +4294967295 `divMod` 4294967295 = (1,0) +4294967295 `divMod` 0 = divide by zero +4294967295 `divMod` 1 = (4294967295,0) +4294967295 `divMod` 2 = (2147483647,1) +4294967295 `divMod` 3 = (1431655765,0) + +0 `divMod` 4294967293 = (0,0) +0 `divMod` 4294967294 = (0,0) +0 `divMod` 4294967295 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 4294967293 = (0,1) +1 `divMod` 4294967294 = (0,1) +1 `divMod` 4294967295 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 4294967293 = (0,2) +2 `divMod` 4294967294 = (0,2) +2 `divMod` 4294967295 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 4294967293 = (0,3) +3 `divMod` 4294967294 = (0,3) +3 `divMod` 4294967295 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +4294967293 `div` 4294967293 = 1 +4294967293 `div` 4294967294 = 0 +4294967293 `div` 4294967295 = 0 +4294967293 `div` 0 = divide by zero +4294967293 `div` 1 = 4294967293 +4294967293 `div` 2 = 2147483646 +4294967293 `div` 3 = 1431655764 + +4294967294 `div` 4294967293 = 1 +4294967294 `div` 4294967294 = 1 +4294967294 `div` 4294967295 = 0 +4294967294 `div` 0 = divide by zero +4294967294 `div` 1 = 4294967294 +4294967294 `div` 2 = 2147483647 +4294967294 `div` 3 = 1431655764 + +4294967295 `div` 4294967293 = 1 +4294967295 `div` 4294967294 = 1 +4294967295 `div` 4294967295 = 1 +4294967295 `div` 0 = divide by zero +4294967295 `div` 1 = 4294967295 +4294967295 `div` 2 = 2147483647 +4294967295 `div` 3 = 1431655765 + +0 `div` 4294967293 = 0 +0 `div` 4294967294 = 0 +0 `div` 4294967295 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 4294967293 = 0 +1 `div` 4294967294 = 0 +1 `div` 4294967295 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 4294967293 = 0 +2 `div` 4294967294 = 0 +2 `div` 4294967295 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 4294967293 = 0 +3 `div` 4294967294 = 0 +3 `div` 4294967295 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +4294967293 `mod` 4294967293 = 0 +4294967293 `mod` 4294967294 = 4294967293 +4294967293 `mod` 4294967295 = 4294967293 +4294967293 `mod` 0 = divide by zero +4294967293 `mod` 1 = 0 +4294967293 `mod` 2 = 1 +4294967293 `mod` 3 = 1 + +4294967294 `mod` 4294967293 = 1 +4294967294 `mod` 4294967294 = 0 +4294967294 `mod` 4294967295 = 4294967294 +4294967294 `mod` 0 = divide by zero +4294967294 `mod` 1 = 0 +4294967294 `mod` 2 = 0 +4294967294 `mod` 3 = 2 + +4294967295 `mod` 4294967293 = 2 +4294967295 `mod` 4294967294 = 1 +4294967295 `mod` 4294967295 = 0 +4294967295 `mod` 0 = divide by zero +4294967295 `mod` 1 = 0 +4294967295 `mod` 2 = 1 +4294967295 `mod` 3 = 0 + +0 `mod` 4294967293 = 0 +0 `mod` 4294967294 = 0 +0 `mod` 4294967295 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 4294967293 = 1 +1 `mod` 4294967294 = 1 +1 `mod` 4294967295 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 4294967293 = 2 +2 `mod` 4294967294 = 2 +2 `mod` 4294967295 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 4294967293 = 3 +3 `mod` 4294967294 = 3 +3 `mod` 4294967295 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +4294967293 `quotRem` 4294967293 = (1,0) +4294967293 `quotRem` 4294967294 = (0,4294967293) +4294967293 `quotRem` 4294967295 = (0,4294967293) +4294967293 `quotRem` 0 = divide by zero +4294967293 `quotRem` 1 = (4294967293,0) +4294967293 `quotRem` 2 = (2147483646,1) +4294967293 `quotRem` 3 = (1431655764,1) + +4294967294 `quotRem` 4294967293 = (1,1) +4294967294 `quotRem` 4294967294 = (1,0) +4294967294 `quotRem` 4294967295 = (0,4294967294) +4294967294 `quotRem` 0 = divide by zero +4294967294 `quotRem` 1 = (4294967294,0) +4294967294 `quotRem` 2 = (2147483647,0) +4294967294 `quotRem` 3 = (1431655764,2) + +4294967295 `quotRem` 4294967293 = (1,2) +4294967295 `quotRem` 4294967294 = (1,1) +4294967295 `quotRem` 4294967295 = (1,0) +4294967295 `quotRem` 0 = divide by zero +4294967295 `quotRem` 1 = (4294967295,0) +4294967295 `quotRem` 2 = (2147483647,1) +4294967295 `quotRem` 3 = (1431655765,0) + +0 `quotRem` 4294967293 = (0,0) +0 `quotRem` 4294967294 = (0,0) +0 `quotRem` 4294967295 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 4294967293 = (0,1) +1 `quotRem` 4294967294 = (0,1) +1 `quotRem` 4294967295 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 4294967293 = (0,2) +2 `quotRem` 4294967294 = (0,2) +2 `quotRem` 4294967295 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 4294967293 = (0,3) +3 `quotRem` 4294967294 = (0,3) +3 `quotRem` 4294967295 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +4294967293 `quot` 4294967293 = 1 +4294967293 `quot` 4294967294 = 0 +4294967293 `quot` 4294967295 = 0 +4294967293 `quot` 0 = divide by zero +4294967293 `quot` 1 = 4294967293 +4294967293 `quot` 2 = 2147483646 +4294967293 `quot` 3 = 1431655764 + +4294967294 `quot` 4294967293 = 1 +4294967294 `quot` 4294967294 = 1 +4294967294 `quot` 4294967295 = 0 +4294967294 `quot` 0 = divide by zero +4294967294 `quot` 1 = 4294967294 +4294967294 `quot` 2 = 2147483647 +4294967294 `quot` 3 = 1431655764 + +4294967295 `quot` 4294967293 = 1 +4294967295 `quot` 4294967294 = 1 +4294967295 `quot` 4294967295 = 1 +4294967295 `quot` 0 = divide by zero +4294967295 `quot` 1 = 4294967295 +4294967295 `quot` 2 = 2147483647 +4294967295 `quot` 3 = 1431655765 + +0 `quot` 4294967293 = 0 +0 `quot` 4294967294 = 0 +0 `quot` 4294967295 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 4294967293 = 0 +1 `quot` 4294967294 = 0 +1 `quot` 4294967295 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 4294967293 = 0 +2 `quot` 4294967294 = 0 +2 `quot` 4294967295 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 4294967293 = 0 +3 `quot` 4294967294 = 0 +3 `quot` 4294967295 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +4294967293 `rem` 4294967293 = 0 +4294967293 `rem` 4294967294 = 4294967293 +4294967293 `rem` 4294967295 = 4294967293 +4294967293 `rem` 0 = divide by zero +4294967293 `rem` 1 = 0 +4294967293 `rem` 2 = 1 +4294967293 `rem` 3 = 1 + +4294967294 `rem` 4294967293 = 1 +4294967294 `rem` 4294967294 = 0 +4294967294 `rem` 4294967295 = 4294967294 +4294967294 `rem` 0 = divide by zero +4294967294 `rem` 1 = 0 +4294967294 `rem` 2 = 0 +4294967294 `rem` 3 = 2 + +4294967295 `rem` 4294967293 = 2 +4294967295 `rem` 4294967294 = 1 +4294967295 `rem` 4294967295 = 0 +4294967295 `rem` 0 = divide by zero +4294967295 `rem` 1 = 0 +4294967295 `rem` 2 = 1 +4294967295 `rem` 3 = 0 + +0 `rem` 4294967293 = 0 +0 `rem` 4294967294 = 0 +0 `rem` 4294967295 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 4294967293 = 1 +1 `rem` 4294967294 = 1 +1 `rem` 4294967295 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 4294967293 = 2 +2 `rem` 4294967294 = 2 +2 `rem` 4294967295 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 4294967293 = 3 +3 `rem` 4294967294 = 3 +3 `rem` 4294967295 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,4294967295] +Int : [0,0,4294967295] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [0,0,4294967295] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [0,0,4294967295] +testBits +4294967293 .&. 4294967293 = 4294967293 +4294967293 .&. 4294967294 = 4294967292 +4294967293 .&. 4294967295 = 4294967293 +4294967293 .&. 0 = 0 +4294967293 .&. 1 = 1 +4294967293 .&. 2 = 0 +4294967293 .&. 3 = 1 + +4294967294 .&. 4294967293 = 4294967292 +4294967294 .&. 4294967294 = 4294967294 +4294967294 .&. 4294967295 = 4294967294 +4294967294 .&. 0 = 0 +4294967294 .&. 1 = 0 +4294967294 .&. 2 = 2 +4294967294 .&. 3 = 2 + +4294967295 .&. 4294967293 = 4294967293 +4294967295 .&. 4294967294 = 4294967294 +4294967295 .&. 4294967295 = 4294967295 +4294967295 .&. 0 = 0 +4294967295 .&. 1 = 1 +4294967295 .&. 2 = 2 +4294967295 .&. 3 = 3 + +0 .&. 4294967293 = 0 +0 .&. 4294967294 = 0 +0 .&. 4294967295 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 4294967293 = 1 +1 .&. 4294967294 = 0 +1 .&. 4294967295 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 4294967293 = 0 +2 .&. 4294967294 = 2 +2 .&. 4294967295 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 4294967293 = 1 +3 .&. 4294967294 = 2 +3 .&. 4294967295 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +4294967293 .|. 4294967293 = 4294967293 +4294967293 .|. 4294967294 = 4294967295 +4294967293 .|. 4294967295 = 4294967295 +4294967293 .|. 0 = 4294967293 +4294967293 .|. 1 = 4294967293 +4294967293 .|. 2 = 4294967295 +4294967293 .|. 3 = 4294967295 + +4294967294 .|. 4294967293 = 4294967295 +4294967294 .|. 4294967294 = 4294967294 +4294967294 .|. 4294967295 = 4294967295 +4294967294 .|. 0 = 4294967294 +4294967294 .|. 1 = 4294967295 +4294967294 .|. 2 = 4294967294 +4294967294 .|. 3 = 4294967295 + +4294967295 .|. 4294967293 = 4294967295 +4294967295 .|. 4294967294 = 4294967295 +4294967295 .|. 4294967295 = 4294967295 +4294967295 .|. 0 = 4294967295 +4294967295 .|. 1 = 4294967295 +4294967295 .|. 2 = 4294967295 +4294967295 .|. 3 = 4294967295 + +0 .|. 4294967293 = 4294967293 +0 .|. 4294967294 = 4294967294 +0 .|. 4294967295 = 4294967295 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 4294967293 = 4294967293 +1 .|. 4294967294 = 4294967295 +1 .|. 4294967295 = 4294967295 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 4294967293 = 4294967295 +2 .|. 4294967294 = 4294967294 +2 .|. 4294967295 = 4294967295 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 4294967293 = 4294967295 +3 .|. 4294967294 = 4294967295 +3 .|. 4294967295 = 4294967295 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +4294967293 `xor` 4294967293 = 0 +4294967293 `xor` 4294967294 = 3 +4294967293 `xor` 4294967295 = 2 +4294967293 `xor` 0 = 4294967293 +4294967293 `xor` 1 = 4294967292 +4294967293 `xor` 2 = 4294967295 +4294967293 `xor` 3 = 4294967294 + +4294967294 `xor` 4294967293 = 3 +4294967294 `xor` 4294967294 = 0 +4294967294 `xor` 4294967295 = 1 +4294967294 `xor` 0 = 4294967294 +4294967294 `xor` 1 = 4294967295 +4294967294 `xor` 2 = 4294967292 +4294967294 `xor` 3 = 4294967293 + +4294967295 `xor` 4294967293 = 2 +4294967295 `xor` 4294967294 = 1 +4294967295 `xor` 4294967295 = 0 +4294967295 `xor` 0 = 4294967295 +4294967295 `xor` 1 = 4294967294 +4294967295 `xor` 2 = 4294967293 +4294967295 `xor` 3 = 4294967292 + +0 `xor` 4294967293 = 4294967293 +0 `xor` 4294967294 = 4294967294 +0 `xor` 4294967295 = 4294967295 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 4294967293 = 4294967292 +1 `xor` 4294967294 = 4294967295 +1 `xor` 4294967295 = 4294967294 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 4294967293 = 4294967295 +2 `xor` 4294967294 = 4294967292 +2 `xor` 4294967295 = 4294967293 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 4294967293 = 4294967294 +3 `xor` 4294967294 = 4294967293 +3 `xor` 4294967295 = 4294967292 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 4294967293 = 2 +complement 4294967294 = 1 +complement 4294967295 = 0 +complement 0 = 4294967295 +complement 1 = 4294967294 +complement 2 = 4294967293 +complement 3 = 4294967292 +# +4294967293 `shiftL` 0 = 4294967293 +4294967293 `shiftL` 1 = 4294967290 +4294967293 `shiftL` 2 = 4294967284 +4294967293 `shiftL` 3 = 4294967272 +4294967293 `shiftL` 32 = 0 +4294967293 `shiftL` 64 = 0 + +4294967294 `shiftL` 0 = 4294967294 +4294967294 `shiftL` 1 = 4294967292 +4294967294 `shiftL` 2 = 4294967288 +4294967294 `shiftL` 3 = 4294967280 +4294967294 `shiftL` 32 = 0 +4294967294 `shiftL` 64 = 0 + +4294967295 `shiftL` 0 = 4294967295 +4294967295 `shiftL` 1 = 4294967294 +4294967295 `shiftL` 2 = 4294967292 +4294967295 `shiftL` 3 = 4294967288 +4294967295 `shiftL` 32 = 0 +4294967295 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 0 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 0 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 0 +3 `shiftL` 64 = 0 + +# +4294967293 `shiftR` 0 = 4294967293 +4294967293 `shiftR` 1 = 2147483646 +4294967293 `shiftR` 2 = 1073741823 +4294967293 `shiftR` 3 = 536870911 +4294967293 `shiftR` 32 = 0 +4294967293 `shiftR` 64 = 0 + +4294967294 `shiftR` 0 = 4294967294 +4294967294 `shiftR` 1 = 2147483647 +4294967294 `shiftR` 2 = 1073741823 +4294967294 `shiftR` 3 = 536870911 +4294967294 `shiftR` 32 = 0 +4294967294 `shiftR` 64 = 0 + +4294967295 `shiftR` 0 = 4294967295 +4294967295 `shiftR` 1 = 2147483647 +4294967295 `shiftR` 2 = 1073741823 +4294967295 `shiftR` 3 = 536870911 +4294967295 `shiftR` 32 = 0 +4294967295 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +4294967293 `rotate` -3 = 3221225471 +4294967293 `rotate` -2 = 2147483647 +4294967293 `rotate` -1 = 4294967294 +4294967293 `rotate` 0 = 4294967293 +4294967293 `rotate` 1 = 4294967291 +4294967293 `rotate` 2 = 4294967287 +4294967293 `rotate` 3 = 4294967279 +4294967293 `rotate` -64 = 4294967293 +4294967293 `rotate` -32 = 4294967293 +4294967293 `rotate` 32 = 4294967293 +4294967293 `rotate` 64 = 4294967293 + +4294967294 `rotate` -3 = 3758096383 +4294967294 `rotate` -2 = 3221225471 +4294967294 `rotate` -1 = 2147483647 +4294967294 `rotate` 0 = 4294967294 +4294967294 `rotate` 1 = 4294967293 +4294967294 `rotate` 2 = 4294967291 +4294967294 `rotate` 3 = 4294967287 +4294967294 `rotate` -64 = 4294967294 +4294967294 `rotate` -32 = 4294967294 +4294967294 `rotate` 32 = 4294967294 +4294967294 `rotate` 64 = 4294967294 + +4294967295 `rotate` -3 = 4294967295 +4294967295 `rotate` -2 = 4294967295 +4294967295 `rotate` -1 = 4294967295 +4294967295 `rotate` 0 = 4294967295 +4294967295 `rotate` 1 = 4294967295 +4294967295 `rotate` 2 = 4294967295 +4294967295 `rotate` 3 = 4294967295 +4294967295 `rotate` -64 = 4294967295 +4294967295 `rotate` -32 = 4294967295 +4294967295 `rotate` 32 = 4294967295 +4294967295 `rotate` 64 = 4294967295 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 536870912 +1 `rotate` -2 = 1073741824 +1 `rotate` -1 = 2147483648 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 1 +1 `rotate` 32 = 1 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 1073741824 +2 `rotate` -2 = 2147483648 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 2 +2 `rotate` 32 = 2 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 1610612736 +3 `rotate` -2 = 3221225472 +3 `rotate` -1 = 2147483649 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 3 +3 `rotate` 32 = 3 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +4294967293 `setBit` 0 = 4294967293 +4294967293 `setBit` 1 = 4294967295 +4294967293 `setBit` 2 = 4294967293 +4294967293 `setBit` 3 = 4294967293 +4294967293 `setBit` 32 = 4294967293 +4294967293 `setBit` 64 = 4294967293 + +4294967294 `setBit` 0 = 4294967295 +4294967294 `setBit` 1 = 4294967294 +4294967294 `setBit` 2 = 4294967294 +4294967294 `setBit` 3 = 4294967294 +4294967294 `setBit` 32 = 4294967294 +4294967294 `setBit` 64 = 4294967294 + +4294967295 `setBit` 0 = 4294967295 +4294967295 `setBit` 1 = 4294967295 +4294967295 `setBit` 2 = 4294967295 +4294967295 `setBit` 3 = 4294967295 +4294967295 `setBit` 32 = 4294967295 +4294967295 `setBit` 64 = 4294967295 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 0 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 1 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 2 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 3 +3 `setBit` 64 = 3 + +# +4294967293 `clearBit` 0 = 4294967292 +4294967293 `clearBit` 1 = 4294967293 +4294967293 `clearBit` 2 = 4294967289 +4294967293 `clearBit` 3 = 4294967285 +4294967293 `clearBit` 32 = 4294967293 +4294967293 `clearBit` 64 = 4294967293 + +4294967294 `clearBit` 0 = 4294967294 +4294967294 `clearBit` 1 = 4294967292 +4294967294 `clearBit` 2 = 4294967290 +4294967294 `clearBit` 3 = 4294967286 +4294967294 `clearBit` 32 = 4294967294 +4294967294 `clearBit` 64 = 4294967294 + +4294967295 `clearBit` 0 = 4294967294 +4294967295 `clearBit` 1 = 4294967293 +4294967295 `clearBit` 2 = 4294967291 +4294967295 `clearBit` 3 = 4294967287 +4294967295 `clearBit` 32 = 4294967295 +4294967295 `clearBit` 64 = 4294967295 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +4294967293 `complementBit` 0 = 4294967292 +4294967293 `complementBit` 1 = 4294967295 +4294967293 `complementBit` 2 = 4294967289 +4294967293 `complementBit` 3 = 4294967285 +4294967293 `complementBit` 32 = 4294967293 +4294967293 `complementBit` 64 = 4294967293 + +4294967294 `complementBit` 0 = 4294967295 +4294967294 `complementBit` 1 = 4294967292 +4294967294 `complementBit` 2 = 4294967290 +4294967294 `complementBit` 3 = 4294967286 +4294967294 `complementBit` 32 = 4294967294 +4294967294 `complementBit` 64 = 4294967294 + +4294967295 `complementBit` 0 = 4294967294 +4294967295 `complementBit` 1 = 4294967293 +4294967295 `complementBit` 2 = 4294967291 +4294967295 `complementBit` 3 = 4294967287 +4294967295 `complementBit` 32 = 4294967295 +4294967295 `complementBit` 64 = 4294967295 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 0 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 1 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 2 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 3 +3 `complementBit` 64 = 3 + +# +4294967293 `testBit` 0 = True +4294967293 `testBit` 1 = False +4294967293 `testBit` 2 = True +4294967293 `testBit` 3 = True +4294967293 `testBit` 32 = False +4294967293 `testBit` 64 = False + +4294967294 `testBit` 0 = False +4294967294 `testBit` 1 = True +4294967294 `testBit` 2 = True +4294967294 `testBit` 3 = True +4294967294 `testBit` 32 = False +4294967294 `testBit` 64 = False + +4294967295 `testBit` 0 = True +4294967295 `testBit` 1 = True +4294967295 `testBit` 2 = True +4294967295 `testBit` 3 = True +4294967295 `testBit` 32 = False +4294967295 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 4294967293 = 32 +bitSize 4294967294 = 32 +bitSize 4294967295 = 32 +bitSize 0 = 32 +bitSize 1 = 32 +bitSize 2 = 32 +bitSize 3 = 32 +# +isSigned 4294967293 = False +isSigned 4294967294 = False +isSigned 4294967295 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Word64 +-------------------------------- +testBounded +(18446744073709551615,0,1) +(18446744073709551614,18446744073709551615,0) +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[18446744073709551613,18446744073709551614,18446744073709551615,0,1,2,3] +[18446744073709551613,18446744073709551614,18446744073709551615,0,1,2,3] +testEq +18446744073709551613 == 18446744073709551613 = True +18446744073709551613 == 18446744073709551614 = False +18446744073709551613 == 18446744073709551615 = False +18446744073709551613 == 0 = False +18446744073709551613 == 1 = False +18446744073709551613 == 2 = False +18446744073709551613 == 3 = False + +18446744073709551614 == 18446744073709551613 = False +18446744073709551614 == 18446744073709551614 = True +18446744073709551614 == 18446744073709551615 = False +18446744073709551614 == 0 = False +18446744073709551614 == 1 = False +18446744073709551614 == 2 = False +18446744073709551614 == 3 = False + +18446744073709551615 == 18446744073709551613 = False +18446744073709551615 == 18446744073709551614 = False +18446744073709551615 == 18446744073709551615 = True +18446744073709551615 == 0 = False +18446744073709551615 == 1 = False +18446744073709551615 == 2 = False +18446744073709551615 == 3 = False + +0 == 18446744073709551613 = False +0 == 18446744073709551614 = False +0 == 18446744073709551615 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == 18446744073709551613 = False +1 == 18446744073709551614 = False +1 == 18446744073709551615 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == 18446744073709551613 = False +2 == 18446744073709551614 = False +2 == 18446744073709551615 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == 18446744073709551613 = False +3 == 18446744073709551614 = False +3 == 18446744073709551615 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +18446744073709551613 /= 18446744073709551613 = False +18446744073709551613 /= 18446744073709551614 = True +18446744073709551613 /= 18446744073709551615 = True +18446744073709551613 /= 0 = True +18446744073709551613 /= 1 = True +18446744073709551613 /= 2 = True +18446744073709551613 /= 3 = True + +18446744073709551614 /= 18446744073709551613 = True +18446744073709551614 /= 18446744073709551614 = False +18446744073709551614 /= 18446744073709551615 = True +18446744073709551614 /= 0 = True +18446744073709551614 /= 1 = True +18446744073709551614 /= 2 = True +18446744073709551614 /= 3 = True + +18446744073709551615 /= 18446744073709551613 = True +18446744073709551615 /= 18446744073709551614 = True +18446744073709551615 /= 18446744073709551615 = False +18446744073709551615 /= 0 = True +18446744073709551615 /= 1 = True +18446744073709551615 /= 2 = True +18446744073709551615 /= 3 = True + +0 /= 18446744073709551613 = True +0 /= 18446744073709551614 = True +0 /= 18446744073709551615 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= 18446744073709551613 = True +1 /= 18446744073709551614 = True +1 /= 18446744073709551615 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= 18446744073709551613 = True +2 /= 18446744073709551614 = True +2 /= 18446744073709551615 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= 18446744073709551613 = True +3 /= 18446744073709551614 = True +3 /= 18446744073709551615 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +18446744073709551613 <= 18446744073709551613 = True +18446744073709551613 <= 18446744073709551614 = True +18446744073709551613 <= 18446744073709551615 = True +18446744073709551613 <= 0 = False +18446744073709551613 <= 1 = False +18446744073709551613 <= 2 = False +18446744073709551613 <= 3 = False + +18446744073709551614 <= 18446744073709551613 = False +18446744073709551614 <= 18446744073709551614 = True +18446744073709551614 <= 18446744073709551615 = True +18446744073709551614 <= 0 = False +18446744073709551614 <= 1 = False +18446744073709551614 <= 2 = False +18446744073709551614 <= 3 = False + +18446744073709551615 <= 18446744073709551613 = False +18446744073709551615 <= 18446744073709551614 = False +18446744073709551615 <= 18446744073709551615 = True +18446744073709551615 <= 0 = False +18446744073709551615 <= 1 = False +18446744073709551615 <= 2 = False +18446744073709551615 <= 3 = False + +0 <= 18446744073709551613 = True +0 <= 18446744073709551614 = True +0 <= 18446744073709551615 = True +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= 18446744073709551613 = True +1 <= 18446744073709551614 = True +1 <= 18446744073709551615 = True +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= 18446744073709551613 = True +2 <= 18446744073709551614 = True +2 <= 18446744073709551615 = True +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= 18446744073709551613 = True +3 <= 18446744073709551614 = True +3 <= 18446744073709551615 = True +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +18446744073709551613 < 18446744073709551613 = False +18446744073709551613 < 18446744073709551614 = True +18446744073709551613 < 18446744073709551615 = True +18446744073709551613 < 0 = False +18446744073709551613 < 1 = False +18446744073709551613 < 2 = False +18446744073709551613 < 3 = False + +18446744073709551614 < 18446744073709551613 = False +18446744073709551614 < 18446744073709551614 = False +18446744073709551614 < 18446744073709551615 = True +18446744073709551614 < 0 = False +18446744073709551614 < 1 = False +18446744073709551614 < 2 = False +18446744073709551614 < 3 = False + +18446744073709551615 < 18446744073709551613 = False +18446744073709551615 < 18446744073709551614 = False +18446744073709551615 < 18446744073709551615 = False +18446744073709551615 < 0 = False +18446744073709551615 < 1 = False +18446744073709551615 < 2 = False +18446744073709551615 < 3 = False + +0 < 18446744073709551613 = True +0 < 18446744073709551614 = True +0 < 18446744073709551615 = True +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < 18446744073709551613 = True +1 < 18446744073709551614 = True +1 < 18446744073709551615 = True +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < 18446744073709551613 = True +2 < 18446744073709551614 = True +2 < 18446744073709551615 = True +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < 18446744073709551613 = True +3 < 18446744073709551614 = True +3 < 18446744073709551615 = True +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +18446744073709551613 > 18446744073709551613 = False +18446744073709551613 > 18446744073709551614 = False +18446744073709551613 > 18446744073709551615 = False +18446744073709551613 > 0 = True +18446744073709551613 > 1 = True +18446744073709551613 > 2 = True +18446744073709551613 > 3 = True + +18446744073709551614 > 18446744073709551613 = True +18446744073709551614 > 18446744073709551614 = False +18446744073709551614 > 18446744073709551615 = False +18446744073709551614 > 0 = True +18446744073709551614 > 1 = True +18446744073709551614 > 2 = True +18446744073709551614 > 3 = True + +18446744073709551615 > 18446744073709551613 = True +18446744073709551615 > 18446744073709551614 = True +18446744073709551615 > 18446744073709551615 = False +18446744073709551615 > 0 = True +18446744073709551615 > 1 = True +18446744073709551615 > 2 = True +18446744073709551615 > 3 = True + +0 > 18446744073709551613 = False +0 > 18446744073709551614 = False +0 > 18446744073709551615 = False +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > 18446744073709551613 = False +1 > 18446744073709551614 = False +1 > 18446744073709551615 = False +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > 18446744073709551613 = False +2 > 18446744073709551614 = False +2 > 18446744073709551615 = False +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > 18446744073709551613 = False +3 > 18446744073709551614 = False +3 > 18446744073709551615 = False +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +18446744073709551613 >= 18446744073709551613 = True +18446744073709551613 >= 18446744073709551614 = False +18446744073709551613 >= 18446744073709551615 = False +18446744073709551613 >= 0 = True +18446744073709551613 >= 1 = True +18446744073709551613 >= 2 = True +18446744073709551613 >= 3 = True + +18446744073709551614 >= 18446744073709551613 = True +18446744073709551614 >= 18446744073709551614 = True +18446744073709551614 >= 18446744073709551615 = False +18446744073709551614 >= 0 = True +18446744073709551614 >= 1 = True +18446744073709551614 >= 2 = True +18446744073709551614 >= 3 = True + +18446744073709551615 >= 18446744073709551613 = True +18446744073709551615 >= 18446744073709551614 = True +18446744073709551615 >= 18446744073709551615 = True +18446744073709551615 >= 0 = True +18446744073709551615 >= 1 = True +18446744073709551615 >= 2 = True +18446744073709551615 >= 3 = True + +0 >= 18446744073709551613 = False +0 >= 18446744073709551614 = False +0 >= 18446744073709551615 = False +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= 18446744073709551613 = False +1 >= 18446744073709551614 = False +1 >= 18446744073709551615 = False +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= 18446744073709551613 = False +2 >= 18446744073709551614 = False +2 >= 18446744073709551615 = False +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= 18446744073709551613 = False +3 >= 18446744073709551614 = False +3 >= 18446744073709551615 = False +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +18446744073709551613 `compare` 18446744073709551613 = EQ +18446744073709551613 `compare` 18446744073709551614 = LT +18446744073709551613 `compare` 18446744073709551615 = LT +18446744073709551613 `compare` 0 = GT +18446744073709551613 `compare` 1 = GT +18446744073709551613 `compare` 2 = GT +18446744073709551613 `compare` 3 = GT + +18446744073709551614 `compare` 18446744073709551613 = GT +18446744073709551614 `compare` 18446744073709551614 = EQ +18446744073709551614 `compare` 18446744073709551615 = LT +18446744073709551614 `compare` 0 = GT +18446744073709551614 `compare` 1 = GT +18446744073709551614 `compare` 2 = GT +18446744073709551614 `compare` 3 = GT + +18446744073709551615 `compare` 18446744073709551613 = GT +18446744073709551615 `compare` 18446744073709551614 = GT +18446744073709551615 `compare` 18446744073709551615 = EQ +18446744073709551615 `compare` 0 = GT +18446744073709551615 `compare` 1 = GT +18446744073709551615 `compare` 2 = GT +18446744073709551615 `compare` 3 = GT + +0 `compare` 18446744073709551613 = LT +0 `compare` 18446744073709551614 = LT +0 `compare` 18446744073709551615 = LT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` 18446744073709551613 = LT +1 `compare` 18446744073709551614 = LT +1 `compare` 18446744073709551615 = LT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` 18446744073709551613 = LT +2 `compare` 18446744073709551614 = LT +2 `compare` 18446744073709551615 = LT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` 18446744073709551613 = LT +3 `compare` 18446744073709551614 = LT +3 `compare` 18446744073709551615 = LT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +18446744073709551613 + 18446744073709551613 = 18446744073709551610 +18446744073709551613 + 18446744073709551614 = 18446744073709551611 +18446744073709551613 + 18446744073709551615 = 18446744073709551612 +18446744073709551613 + 0 = 18446744073709551613 +18446744073709551613 + 1 = 18446744073709551614 +18446744073709551613 + 2 = 18446744073709551615 +18446744073709551613 + 3 = 0 + +18446744073709551614 + 18446744073709551613 = 18446744073709551611 +18446744073709551614 + 18446744073709551614 = 18446744073709551612 +18446744073709551614 + 18446744073709551615 = 18446744073709551613 +18446744073709551614 + 0 = 18446744073709551614 +18446744073709551614 + 1 = 18446744073709551615 +18446744073709551614 + 2 = 0 +18446744073709551614 + 3 = 1 + +18446744073709551615 + 18446744073709551613 = 18446744073709551612 +18446744073709551615 + 18446744073709551614 = 18446744073709551613 +18446744073709551615 + 18446744073709551615 = 18446744073709551614 +18446744073709551615 + 0 = 18446744073709551615 +18446744073709551615 + 1 = 0 +18446744073709551615 + 2 = 1 +18446744073709551615 + 3 = 2 + +0 + 18446744073709551613 = 18446744073709551613 +0 + 18446744073709551614 = 18446744073709551614 +0 + 18446744073709551615 = 18446744073709551615 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + 18446744073709551613 = 18446744073709551614 +1 + 18446744073709551614 = 18446744073709551615 +1 + 18446744073709551615 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + 18446744073709551613 = 18446744073709551615 +2 + 18446744073709551614 = 0 +2 + 18446744073709551615 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + 18446744073709551613 = 0 +3 + 18446744073709551614 = 1 +3 + 18446744073709551615 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +18446744073709551613 - 18446744073709551613 = 0 +18446744073709551613 - 18446744073709551614 = 18446744073709551615 +18446744073709551613 - 18446744073709551615 = 18446744073709551614 +18446744073709551613 - 0 = 18446744073709551613 +18446744073709551613 - 1 = 18446744073709551612 +18446744073709551613 - 2 = 18446744073709551611 +18446744073709551613 - 3 = 18446744073709551610 + +18446744073709551614 - 18446744073709551613 = 1 +18446744073709551614 - 18446744073709551614 = 0 +18446744073709551614 - 18446744073709551615 = 18446744073709551615 +18446744073709551614 - 0 = 18446744073709551614 +18446744073709551614 - 1 = 18446744073709551613 +18446744073709551614 - 2 = 18446744073709551612 +18446744073709551614 - 3 = 18446744073709551611 + +18446744073709551615 - 18446744073709551613 = 2 +18446744073709551615 - 18446744073709551614 = 1 +18446744073709551615 - 18446744073709551615 = 0 +18446744073709551615 - 0 = 18446744073709551615 +18446744073709551615 - 1 = 18446744073709551614 +18446744073709551615 - 2 = 18446744073709551613 +18446744073709551615 - 3 = 18446744073709551612 + +0 - 18446744073709551613 = 3 +0 - 18446744073709551614 = 2 +0 - 18446744073709551615 = 1 +0 - 0 = 0 +0 - 1 = 18446744073709551615 +0 - 2 = 18446744073709551614 +0 - 3 = 18446744073709551613 + +1 - 18446744073709551613 = 4 +1 - 18446744073709551614 = 3 +1 - 18446744073709551615 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = 18446744073709551615 +1 - 3 = 18446744073709551614 + +2 - 18446744073709551613 = 5 +2 - 18446744073709551614 = 4 +2 - 18446744073709551615 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = 18446744073709551615 + +3 - 18446744073709551613 = 6 +3 - 18446744073709551614 = 5 +3 - 18446744073709551615 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +18446744073709551613 * 18446744073709551613 = 9 +18446744073709551613 * 18446744073709551614 = 6 +18446744073709551613 * 18446744073709551615 = 3 +18446744073709551613 * 0 = 0 +18446744073709551613 * 1 = 18446744073709551613 +18446744073709551613 * 2 = 18446744073709551610 +18446744073709551613 * 3 = 18446744073709551607 + +18446744073709551614 * 18446744073709551613 = 6 +18446744073709551614 * 18446744073709551614 = 4 +18446744073709551614 * 18446744073709551615 = 2 +18446744073709551614 * 0 = 0 +18446744073709551614 * 1 = 18446744073709551614 +18446744073709551614 * 2 = 18446744073709551612 +18446744073709551614 * 3 = 18446744073709551610 + +18446744073709551615 * 18446744073709551613 = 3 +18446744073709551615 * 18446744073709551614 = 2 +18446744073709551615 * 18446744073709551615 = 1 +18446744073709551615 * 0 = 0 +18446744073709551615 * 1 = 18446744073709551615 +18446744073709551615 * 2 = 18446744073709551614 +18446744073709551615 * 3 = 18446744073709551613 + +0 * 18446744073709551613 = 0 +0 * 18446744073709551614 = 0 +0 * 18446744073709551615 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * 18446744073709551613 = 18446744073709551613 +1 * 18446744073709551614 = 18446744073709551614 +1 * 18446744073709551615 = 18446744073709551615 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * 18446744073709551613 = 18446744073709551610 +2 * 18446744073709551614 = 18446744073709551612 +2 * 18446744073709551615 = 18446744073709551614 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * 18446744073709551613 = 18446744073709551607 +3 * 18446744073709551614 = 18446744073709551610 +3 * 18446744073709551615 = 18446744073709551613 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate 18446744073709551613 = 3 +negate 18446744073709551614 = 2 +negate 18446744073709551615 = 1 +negate 0 = 0 +negate 1 = 18446744073709551615 +negate 2 = 18446744073709551614 +negate 3 = 18446744073709551613 +# +testReal +toRational 18446744073709551613 = 18446744073709551613 % 1 +toRational 18446744073709551614 = 18446744073709551614 % 1 +toRational 18446744073709551615 = 18446744073709551615 % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +18446744073709551613 `divMod` 18446744073709551613 = (1,0) +18446744073709551613 `divMod` 18446744073709551614 = (0,18446744073709551613) +18446744073709551613 `divMod` 18446744073709551615 = (0,18446744073709551613) +18446744073709551613 `divMod` 0 = divide by zero +18446744073709551613 `divMod` 1 = (18446744073709551613,0) +18446744073709551613 `divMod` 2 = (9223372036854775806,1) +18446744073709551613 `divMod` 3 = (6148914691236517204,1) + +18446744073709551614 `divMod` 18446744073709551613 = (1,1) +18446744073709551614 `divMod` 18446744073709551614 = (1,0) +18446744073709551614 `divMod` 18446744073709551615 = (0,18446744073709551614) +18446744073709551614 `divMod` 0 = divide by zero +18446744073709551614 `divMod` 1 = (18446744073709551614,0) +18446744073709551614 `divMod` 2 = (9223372036854775807,0) +18446744073709551614 `divMod` 3 = (6148914691236517204,2) + +18446744073709551615 `divMod` 18446744073709551613 = (1,2) +18446744073709551615 `divMod` 18446744073709551614 = (1,1) +18446744073709551615 `divMod` 18446744073709551615 = (1,0) +18446744073709551615 `divMod` 0 = divide by zero +18446744073709551615 `divMod` 1 = (18446744073709551615,0) +18446744073709551615 `divMod` 2 = (9223372036854775807,1) +18446744073709551615 `divMod` 3 = (6148914691236517205,0) + +0 `divMod` 18446744073709551613 = (0,0) +0 `divMod` 18446744073709551614 = (0,0) +0 `divMod` 18446744073709551615 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` 18446744073709551613 = (0,1) +1 `divMod` 18446744073709551614 = (0,1) +1 `divMod` 18446744073709551615 = (0,1) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` 18446744073709551613 = (0,2) +2 `divMod` 18446744073709551614 = (0,2) +2 `divMod` 18446744073709551615 = (0,2) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` 18446744073709551613 = (0,3) +3 `divMod` 18446744073709551614 = (0,3) +3 `divMod` 18446744073709551615 = (0,3) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +18446744073709551613 `div` 18446744073709551613 = 1 +18446744073709551613 `div` 18446744073709551614 = 0 +18446744073709551613 `div` 18446744073709551615 = 0 +18446744073709551613 `div` 0 = divide by zero +18446744073709551613 `div` 1 = 18446744073709551613 +18446744073709551613 `div` 2 = 9223372036854775806 +18446744073709551613 `div` 3 = 6148914691236517204 + +18446744073709551614 `div` 18446744073709551613 = 1 +18446744073709551614 `div` 18446744073709551614 = 1 +18446744073709551614 `div` 18446744073709551615 = 0 +18446744073709551614 `div` 0 = divide by zero +18446744073709551614 `div` 1 = 18446744073709551614 +18446744073709551614 `div` 2 = 9223372036854775807 +18446744073709551614 `div` 3 = 6148914691236517204 + +18446744073709551615 `div` 18446744073709551613 = 1 +18446744073709551615 `div` 18446744073709551614 = 1 +18446744073709551615 `div` 18446744073709551615 = 1 +18446744073709551615 `div` 0 = divide by zero +18446744073709551615 `div` 1 = 18446744073709551615 +18446744073709551615 `div` 2 = 9223372036854775807 +18446744073709551615 `div` 3 = 6148914691236517205 + +0 `div` 18446744073709551613 = 0 +0 `div` 18446744073709551614 = 0 +0 `div` 18446744073709551615 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` 18446744073709551613 = 0 +1 `div` 18446744073709551614 = 0 +1 `div` 18446744073709551615 = 0 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` 18446744073709551613 = 0 +2 `div` 18446744073709551614 = 0 +2 `div` 18446744073709551615 = 0 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` 18446744073709551613 = 0 +3 `div` 18446744073709551614 = 0 +3 `div` 18446744073709551615 = 0 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +18446744073709551613 `mod` 18446744073709551613 = 0 +18446744073709551613 `mod` 18446744073709551614 = 18446744073709551613 +18446744073709551613 `mod` 18446744073709551615 = 18446744073709551613 +18446744073709551613 `mod` 0 = divide by zero +18446744073709551613 `mod` 1 = 0 +18446744073709551613 `mod` 2 = 1 +18446744073709551613 `mod` 3 = 1 + +18446744073709551614 `mod` 18446744073709551613 = 1 +18446744073709551614 `mod` 18446744073709551614 = 0 +18446744073709551614 `mod` 18446744073709551615 = 18446744073709551614 +18446744073709551614 `mod` 0 = divide by zero +18446744073709551614 `mod` 1 = 0 +18446744073709551614 `mod` 2 = 0 +18446744073709551614 `mod` 3 = 2 + +18446744073709551615 `mod` 18446744073709551613 = 2 +18446744073709551615 `mod` 18446744073709551614 = 1 +18446744073709551615 `mod` 18446744073709551615 = 0 +18446744073709551615 `mod` 0 = divide by zero +18446744073709551615 `mod` 1 = 0 +18446744073709551615 `mod` 2 = 1 +18446744073709551615 `mod` 3 = 0 + +0 `mod` 18446744073709551613 = 0 +0 `mod` 18446744073709551614 = 0 +0 `mod` 18446744073709551615 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` 18446744073709551613 = 1 +1 `mod` 18446744073709551614 = 1 +1 `mod` 18446744073709551615 = 1 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` 18446744073709551613 = 2 +2 `mod` 18446744073709551614 = 2 +2 `mod` 18446744073709551615 = 2 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` 18446744073709551613 = 3 +3 `mod` 18446744073709551614 = 3 +3 `mod` 18446744073709551615 = 3 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +18446744073709551613 `quotRem` 18446744073709551613 = (1,0) +18446744073709551613 `quotRem` 18446744073709551614 = (0,18446744073709551613) +18446744073709551613 `quotRem` 18446744073709551615 = (0,18446744073709551613) +18446744073709551613 `quotRem` 0 = divide by zero +18446744073709551613 `quotRem` 1 = (18446744073709551613,0) +18446744073709551613 `quotRem` 2 = (9223372036854775806,1) +18446744073709551613 `quotRem` 3 = (6148914691236517204,1) + +18446744073709551614 `quotRem` 18446744073709551613 = (1,1) +18446744073709551614 `quotRem` 18446744073709551614 = (1,0) +18446744073709551614 `quotRem` 18446744073709551615 = (0,18446744073709551614) +18446744073709551614 `quotRem` 0 = divide by zero +18446744073709551614 `quotRem` 1 = (18446744073709551614,0) +18446744073709551614 `quotRem` 2 = (9223372036854775807,0) +18446744073709551614 `quotRem` 3 = (6148914691236517204,2) + +18446744073709551615 `quotRem` 18446744073709551613 = (1,2) +18446744073709551615 `quotRem` 18446744073709551614 = (1,1) +18446744073709551615 `quotRem` 18446744073709551615 = (1,0) +18446744073709551615 `quotRem` 0 = divide by zero +18446744073709551615 `quotRem` 1 = (18446744073709551615,0) +18446744073709551615 `quotRem` 2 = (9223372036854775807,1) +18446744073709551615 `quotRem` 3 = (6148914691236517205,0) + +0 `quotRem` 18446744073709551613 = (0,0) +0 `quotRem` 18446744073709551614 = (0,0) +0 `quotRem` 18446744073709551615 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` 18446744073709551613 = (0,1) +1 `quotRem` 18446744073709551614 = (0,1) +1 `quotRem` 18446744073709551615 = (0,1) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` 18446744073709551613 = (0,2) +2 `quotRem` 18446744073709551614 = (0,2) +2 `quotRem` 18446744073709551615 = (0,2) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` 18446744073709551613 = (0,3) +3 `quotRem` 18446744073709551614 = (0,3) +3 `quotRem` 18446744073709551615 = (0,3) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +18446744073709551613 `quot` 18446744073709551613 = 1 +18446744073709551613 `quot` 18446744073709551614 = 0 +18446744073709551613 `quot` 18446744073709551615 = 0 +18446744073709551613 `quot` 0 = divide by zero +18446744073709551613 `quot` 1 = 18446744073709551613 +18446744073709551613 `quot` 2 = 9223372036854775806 +18446744073709551613 `quot` 3 = 6148914691236517204 + +18446744073709551614 `quot` 18446744073709551613 = 1 +18446744073709551614 `quot` 18446744073709551614 = 1 +18446744073709551614 `quot` 18446744073709551615 = 0 +18446744073709551614 `quot` 0 = divide by zero +18446744073709551614 `quot` 1 = 18446744073709551614 +18446744073709551614 `quot` 2 = 9223372036854775807 +18446744073709551614 `quot` 3 = 6148914691236517204 + +18446744073709551615 `quot` 18446744073709551613 = 1 +18446744073709551615 `quot` 18446744073709551614 = 1 +18446744073709551615 `quot` 18446744073709551615 = 1 +18446744073709551615 `quot` 0 = divide by zero +18446744073709551615 `quot` 1 = 18446744073709551615 +18446744073709551615 `quot` 2 = 9223372036854775807 +18446744073709551615 `quot` 3 = 6148914691236517205 + +0 `quot` 18446744073709551613 = 0 +0 `quot` 18446744073709551614 = 0 +0 `quot` 18446744073709551615 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` 18446744073709551613 = 0 +1 `quot` 18446744073709551614 = 0 +1 `quot` 18446744073709551615 = 0 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` 18446744073709551613 = 0 +2 `quot` 18446744073709551614 = 0 +2 `quot` 18446744073709551615 = 0 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` 18446744073709551613 = 0 +3 `quot` 18446744073709551614 = 0 +3 `quot` 18446744073709551615 = 0 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +18446744073709551613 `rem` 18446744073709551613 = 0 +18446744073709551613 `rem` 18446744073709551614 = 18446744073709551613 +18446744073709551613 `rem` 18446744073709551615 = 18446744073709551613 +18446744073709551613 `rem` 0 = divide by zero +18446744073709551613 `rem` 1 = 0 +18446744073709551613 `rem` 2 = 1 +18446744073709551613 `rem` 3 = 1 + +18446744073709551614 `rem` 18446744073709551613 = 1 +18446744073709551614 `rem` 18446744073709551614 = 0 +18446744073709551614 `rem` 18446744073709551615 = 18446744073709551614 +18446744073709551614 `rem` 0 = divide by zero +18446744073709551614 `rem` 1 = 0 +18446744073709551614 `rem` 2 = 0 +18446744073709551614 `rem` 3 = 2 + +18446744073709551615 `rem` 18446744073709551613 = 2 +18446744073709551615 `rem` 18446744073709551614 = 1 +18446744073709551615 `rem` 18446744073709551615 = 0 +18446744073709551615 `rem` 0 = divide by zero +18446744073709551615 `rem` 1 = 0 +18446744073709551615 `rem` 2 = 1 +18446744073709551615 `rem` 3 = 0 + +0 `rem` 18446744073709551613 = 0 +0 `rem` 18446744073709551614 = 0 +0 `rem` 18446744073709551615 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` 18446744073709551613 = 1 +1 `rem` 18446744073709551614 = 1 +1 `rem` 18446744073709551615 = 1 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` 18446744073709551613 = 2 +2 `rem` 18446744073709551614 = 2 +2 `rem` 18446744073709551615 = 2 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` 18446744073709551613 = 3 +3 `rem` 18446744073709551614 = 3 +3 `rem` 18446744073709551615 = 3 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testConversions +Integer : [0,0,18446744073709551615] +Int : [0,0,-1] +Int8 : [0,0,-1] +Int16 : [0,0,-1] +Int32 : [0,0,-1] +Int64 : [0,0,-1] +Word8 : [0,0,255] +Word16 : [0,0,65535] +Word32 : [0,0,4294967295] +Word64 : [0,0,18446744073709551615] +testBits +18446744073709551613 .&. 18446744073709551613 = 18446744073709551613 +18446744073709551613 .&. 18446744073709551614 = 18446744073709551612 +18446744073709551613 .&. 18446744073709551615 = 18446744073709551613 +18446744073709551613 .&. 0 = 0 +18446744073709551613 .&. 1 = 1 +18446744073709551613 .&. 2 = 0 +18446744073709551613 .&. 3 = 1 + +18446744073709551614 .&. 18446744073709551613 = 18446744073709551612 +18446744073709551614 .&. 18446744073709551614 = 18446744073709551614 +18446744073709551614 .&. 18446744073709551615 = 18446744073709551614 +18446744073709551614 .&. 0 = 0 +18446744073709551614 .&. 1 = 0 +18446744073709551614 .&. 2 = 2 +18446744073709551614 .&. 3 = 2 + +18446744073709551615 .&. 18446744073709551613 = 18446744073709551613 +18446744073709551615 .&. 18446744073709551614 = 18446744073709551614 +18446744073709551615 .&. 18446744073709551615 = 18446744073709551615 +18446744073709551615 .&. 0 = 0 +18446744073709551615 .&. 1 = 1 +18446744073709551615 .&. 2 = 2 +18446744073709551615 .&. 3 = 3 + +0 .&. 18446744073709551613 = 0 +0 .&. 18446744073709551614 = 0 +0 .&. 18446744073709551615 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. 18446744073709551613 = 1 +1 .&. 18446744073709551614 = 0 +1 .&. 18446744073709551615 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. 18446744073709551613 = 0 +2 .&. 18446744073709551614 = 2 +2 .&. 18446744073709551615 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. 18446744073709551613 = 1 +3 .&. 18446744073709551614 = 2 +3 .&. 18446744073709551615 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +18446744073709551613 .|. 18446744073709551613 = 18446744073709551613 +18446744073709551613 .|. 18446744073709551614 = 18446744073709551615 +18446744073709551613 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551613 .|. 0 = 18446744073709551613 +18446744073709551613 .|. 1 = 18446744073709551613 +18446744073709551613 .|. 2 = 18446744073709551615 +18446744073709551613 .|. 3 = 18446744073709551615 + +18446744073709551614 .|. 18446744073709551613 = 18446744073709551615 +18446744073709551614 .|. 18446744073709551614 = 18446744073709551614 +18446744073709551614 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551614 .|. 0 = 18446744073709551614 +18446744073709551614 .|. 1 = 18446744073709551615 +18446744073709551614 .|. 2 = 18446744073709551614 +18446744073709551614 .|. 3 = 18446744073709551615 + +18446744073709551615 .|. 18446744073709551613 = 18446744073709551615 +18446744073709551615 .|. 18446744073709551614 = 18446744073709551615 +18446744073709551615 .|. 18446744073709551615 = 18446744073709551615 +18446744073709551615 .|. 0 = 18446744073709551615 +18446744073709551615 .|. 1 = 18446744073709551615 +18446744073709551615 .|. 2 = 18446744073709551615 +18446744073709551615 .|. 3 = 18446744073709551615 + +0 .|. 18446744073709551613 = 18446744073709551613 +0 .|. 18446744073709551614 = 18446744073709551614 +0 .|. 18446744073709551615 = 18446744073709551615 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. 18446744073709551613 = 18446744073709551613 +1 .|. 18446744073709551614 = 18446744073709551615 +1 .|. 18446744073709551615 = 18446744073709551615 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. 18446744073709551613 = 18446744073709551615 +2 .|. 18446744073709551614 = 18446744073709551614 +2 .|. 18446744073709551615 = 18446744073709551615 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. 18446744073709551613 = 18446744073709551615 +3 .|. 18446744073709551614 = 18446744073709551615 +3 .|. 18446744073709551615 = 18446744073709551615 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +18446744073709551613 `xor` 18446744073709551613 = 0 +18446744073709551613 `xor` 18446744073709551614 = 3 +18446744073709551613 `xor` 18446744073709551615 = 2 +18446744073709551613 `xor` 0 = 18446744073709551613 +18446744073709551613 `xor` 1 = 18446744073709551612 +18446744073709551613 `xor` 2 = 18446744073709551615 +18446744073709551613 `xor` 3 = 18446744073709551614 + +18446744073709551614 `xor` 18446744073709551613 = 3 +18446744073709551614 `xor` 18446744073709551614 = 0 +18446744073709551614 `xor` 18446744073709551615 = 1 +18446744073709551614 `xor` 0 = 18446744073709551614 +18446744073709551614 `xor` 1 = 18446744073709551615 +18446744073709551614 `xor` 2 = 18446744073709551612 +18446744073709551614 `xor` 3 = 18446744073709551613 + +18446744073709551615 `xor` 18446744073709551613 = 2 +18446744073709551615 `xor` 18446744073709551614 = 1 +18446744073709551615 `xor` 18446744073709551615 = 0 +18446744073709551615 `xor` 0 = 18446744073709551615 +18446744073709551615 `xor` 1 = 18446744073709551614 +18446744073709551615 `xor` 2 = 18446744073709551613 +18446744073709551615 `xor` 3 = 18446744073709551612 + +0 `xor` 18446744073709551613 = 18446744073709551613 +0 `xor` 18446744073709551614 = 18446744073709551614 +0 `xor` 18446744073709551615 = 18446744073709551615 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` 18446744073709551613 = 18446744073709551612 +1 `xor` 18446744073709551614 = 18446744073709551615 +1 `xor` 18446744073709551615 = 18446744073709551614 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` 18446744073709551613 = 18446744073709551615 +2 `xor` 18446744073709551614 = 18446744073709551612 +2 `xor` 18446744073709551615 = 18446744073709551613 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` 18446744073709551613 = 18446744073709551614 +3 `xor` 18446744073709551614 = 18446744073709551613 +3 `xor` 18446744073709551615 = 18446744073709551612 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement 18446744073709551613 = 2 +complement 18446744073709551614 = 1 +complement 18446744073709551615 = 0 +complement 0 = 18446744073709551615 +complement 1 = 18446744073709551614 +complement 2 = 18446744073709551613 +complement 3 = 18446744073709551612 +# +18446744073709551613 `shiftL` 0 = 18446744073709551613 +18446744073709551613 `shiftL` 1 = 18446744073709551610 +18446744073709551613 `shiftL` 2 = 18446744073709551604 +18446744073709551613 `shiftL` 3 = 18446744073709551592 +18446744073709551613 `shiftL` 32 = 18446744060824649728 +18446744073709551613 `shiftL` 64 = 0 + +18446744073709551614 `shiftL` 0 = 18446744073709551614 +18446744073709551614 `shiftL` 1 = 18446744073709551612 +18446744073709551614 `shiftL` 2 = 18446744073709551608 +18446744073709551614 `shiftL` 3 = 18446744073709551600 +18446744073709551614 `shiftL` 32 = 18446744065119617024 +18446744073709551614 `shiftL` 64 = 0 + +18446744073709551615 `shiftL` 0 = 18446744073709551615 +18446744073709551615 `shiftL` 1 = 18446744073709551614 +18446744073709551615 `shiftL` 2 = 18446744073709551612 +18446744073709551615 `shiftL` 3 = 18446744073709551608 +18446744073709551615 `shiftL` 32 = 18446744069414584320 +18446744073709551615 `shiftL` 64 = 0 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 0 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 0 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 0 + +# +18446744073709551613 `shiftR` 0 = 18446744073709551613 +18446744073709551613 `shiftR` 1 = 9223372036854775806 +18446744073709551613 `shiftR` 2 = 4611686018427387903 +18446744073709551613 `shiftR` 3 = 2305843009213693951 +18446744073709551613 `shiftR` 32 = 4294967295 +18446744073709551613 `shiftR` 64 = 0 + +18446744073709551614 `shiftR` 0 = 18446744073709551614 +18446744073709551614 `shiftR` 1 = 9223372036854775807 +18446744073709551614 `shiftR` 2 = 4611686018427387903 +18446744073709551614 `shiftR` 3 = 2305843009213693951 +18446744073709551614 `shiftR` 32 = 4294967295 +18446744073709551614 `shiftR` 64 = 0 + +18446744073709551615 `shiftR` 0 = 18446744073709551615 +18446744073709551615 `shiftR` 1 = 9223372036854775807 +18446744073709551615 `shiftR` 2 = 4611686018427387903 +18446744073709551615 `shiftR` 3 = 2305843009213693951 +18446744073709551615 `shiftR` 32 = 4294967295 +18446744073709551615 `shiftR` 64 = 0 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +18446744073709551613 `rotate` -3 = 13835058055282163711 +18446744073709551613 `rotate` -2 = 9223372036854775807 +18446744073709551613 `rotate` -1 = 18446744073709551614 +18446744073709551613 `rotate` 0 = 18446744073709551613 +18446744073709551613 `rotate` 1 = 18446744073709551611 +18446744073709551613 `rotate` 2 = 18446744073709551607 +18446744073709551613 `rotate` 3 = 18446744073709551599 +18446744073709551613 `rotate` -64 = 18446744073709551613 +18446744073709551613 `rotate` -32 = 18446744065119617023 +18446744073709551613 `rotate` 32 = 18446744065119617023 +18446744073709551613 `rotate` 64 = 18446744073709551613 + +18446744073709551614 `rotate` -3 = 16140901064495857663 +18446744073709551614 `rotate` -2 = 13835058055282163711 +18446744073709551614 `rotate` -1 = 9223372036854775807 +18446744073709551614 `rotate` 0 = 18446744073709551614 +18446744073709551614 `rotate` 1 = 18446744073709551613 +18446744073709551614 `rotate` 2 = 18446744073709551611 +18446744073709551614 `rotate` 3 = 18446744073709551607 +18446744073709551614 `rotate` -64 = 18446744073709551614 +18446744073709551614 `rotate` -32 = 18446744069414584319 +18446744073709551614 `rotate` 32 = 18446744069414584319 +18446744073709551614 `rotate` 64 = 18446744073709551614 + +18446744073709551615 `rotate` -3 = 18446744073709551615 +18446744073709551615 `rotate` -2 = 18446744073709551615 +18446744073709551615 `rotate` -1 = 18446744073709551615 +18446744073709551615 `rotate` 0 = 18446744073709551615 +18446744073709551615 `rotate` 1 = 18446744073709551615 +18446744073709551615 `rotate` 2 = 18446744073709551615 +18446744073709551615 `rotate` 3 = 18446744073709551615 +18446744073709551615 `rotate` -64 = 18446744073709551615 +18446744073709551615 `rotate` -32 = 18446744073709551615 +18446744073709551615 `rotate` 32 = 18446744073709551615 +18446744073709551615 `rotate` 64 = 18446744073709551615 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 2305843009213693952 +1 `rotate` -2 = 4611686018427387904 +1 `rotate` -1 = 9223372036854775808 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 1 +1 `rotate` -32 = 4294967296 +1 `rotate` 32 = 4294967296 +1 `rotate` 64 = 1 + +2 `rotate` -3 = 4611686018427387904 +2 `rotate` -2 = 9223372036854775808 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 2 +2 `rotate` -32 = 8589934592 +2 `rotate` 32 = 8589934592 +2 `rotate` 64 = 2 + +3 `rotate` -3 = 6917529027641081856 +3 `rotate` -2 = 13835058055282163712 +3 `rotate` -1 = 9223372036854775809 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 3 +3 `rotate` -32 = 12884901888 +3 `rotate` 32 = 12884901888 +3 `rotate` 64 = 3 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +18446744073709551613 `setBit` 0 = 18446744073709551613 +18446744073709551613 `setBit` 1 = 18446744073709551615 +18446744073709551613 `setBit` 2 = 18446744073709551613 +18446744073709551613 `setBit` 3 = 18446744073709551613 +18446744073709551613 `setBit` 32 = 18446744073709551613 +18446744073709551613 `setBit` 64 = 18446744073709551613 + +18446744073709551614 `setBit` 0 = 18446744073709551615 +18446744073709551614 `setBit` 1 = 18446744073709551614 +18446744073709551614 `setBit` 2 = 18446744073709551614 +18446744073709551614 `setBit` 3 = 18446744073709551614 +18446744073709551614 `setBit` 32 = 18446744073709551614 +18446744073709551614 `setBit` 64 = 18446744073709551614 + +18446744073709551615 `setBit` 0 = 18446744073709551615 +18446744073709551615 `setBit` 1 = 18446744073709551615 +18446744073709551615 `setBit` 2 = 18446744073709551615 +18446744073709551615 `setBit` 3 = 18446744073709551615 +18446744073709551615 `setBit` 32 = 18446744073709551615 +18446744073709551615 `setBit` 64 = 18446744073709551615 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 0 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 1 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 2 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 3 + +# +18446744073709551613 `clearBit` 0 = 18446744073709551612 +18446744073709551613 `clearBit` 1 = 18446744073709551613 +18446744073709551613 `clearBit` 2 = 18446744073709551609 +18446744073709551613 `clearBit` 3 = 18446744073709551605 +18446744073709551613 `clearBit` 32 = 18446744069414584317 +18446744073709551613 `clearBit` 64 = 18446744073709551613 + +18446744073709551614 `clearBit` 0 = 18446744073709551614 +18446744073709551614 `clearBit` 1 = 18446744073709551612 +18446744073709551614 `clearBit` 2 = 18446744073709551610 +18446744073709551614 `clearBit` 3 = 18446744073709551606 +18446744073709551614 `clearBit` 32 = 18446744069414584318 +18446744073709551614 `clearBit` 64 = 18446744073709551614 + +18446744073709551615 `clearBit` 0 = 18446744073709551614 +18446744073709551615 `clearBit` 1 = 18446744073709551613 +18446744073709551615 `clearBit` 2 = 18446744073709551611 +18446744073709551615 `clearBit` 3 = 18446744073709551607 +18446744073709551615 `clearBit` 32 = 18446744069414584319 +18446744073709551615 `clearBit` 64 = 18446744073709551615 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +18446744073709551613 `complementBit` 0 = 18446744073709551612 +18446744073709551613 `complementBit` 1 = 18446744073709551615 +18446744073709551613 `complementBit` 2 = 18446744073709551609 +18446744073709551613 `complementBit` 3 = 18446744073709551605 +18446744073709551613 `complementBit` 32 = 18446744069414584317 +18446744073709551613 `complementBit` 64 = 18446744073709551613 + +18446744073709551614 `complementBit` 0 = 18446744073709551615 +18446744073709551614 `complementBit` 1 = 18446744073709551612 +18446744073709551614 `complementBit` 2 = 18446744073709551610 +18446744073709551614 `complementBit` 3 = 18446744073709551606 +18446744073709551614 `complementBit` 32 = 18446744069414584318 +18446744073709551614 `complementBit` 64 = 18446744073709551614 + +18446744073709551615 `complementBit` 0 = 18446744073709551614 +18446744073709551615 `complementBit` 1 = 18446744073709551613 +18446744073709551615 `complementBit` 2 = 18446744073709551611 +18446744073709551615 `complementBit` 3 = 18446744073709551607 +18446744073709551615 `complementBit` 32 = 18446744069414584319 +18446744073709551615 `complementBit` 64 = 18446744073709551615 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 0 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 1 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 2 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 3 + +# +18446744073709551613 `testBit` 0 = True +18446744073709551613 `testBit` 1 = False +18446744073709551613 `testBit` 2 = True +18446744073709551613 `testBit` 3 = True +18446744073709551613 `testBit` 32 = True +18446744073709551613 `testBit` 64 = False + +18446744073709551614 `testBit` 0 = False +18446744073709551614 `testBit` 1 = True +18446744073709551614 `testBit` 2 = True +18446744073709551614 `testBit` 3 = True +18446744073709551614 `testBit` 32 = True +18446744073709551614 `testBit` 64 = False + +18446744073709551615 `testBit` 0 = True +18446744073709551615 `testBit` 1 = True +18446744073709551615 `testBit` 2 = True +18446744073709551615 `testBit` 3 = True +18446744073709551615 `testBit` 32 = True +18446744073709551615 `testBit` 64 = False + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +bitSize 18446744073709551613 = 64 +bitSize 18446744073709551614 = 64 +bitSize 18446744073709551615 = 64 +bitSize 0 = 64 +bitSize 1 = 64 +bitSize 2 = 64 +bitSize 3 = 64 +# +isSigned 18446744073709551613 = False +isSigned 18446744073709551614 = False +isSigned 18446744073709551615 = False +isSigned 0 = False +isSigned 1 = False +isSigned 2 = False +isSigned 3 = False +# +-------------------------------- +--Testing Integer +-------------------------------- +testEnum +[0,1,2,3,4,5,6,7,8,9] +[0,2,4,6,8,10,12,14,16,18] +[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] +[0,2,4,6,8,10,12,14,16,18,20] +testReadShow +[-3,-2,-1,0,1,2,3] +[-3,-2,-1,0,1,2,3] +testEq +-3 == -3 = True +-3 == -2 = False +-3 == -1 = False +-3 == 0 = False +-3 == 1 = False +-3 == 2 = False +-3 == 3 = False + +-2 == -3 = False +-2 == -2 = True +-2 == -1 = False +-2 == 0 = False +-2 == 1 = False +-2 == 2 = False +-2 == 3 = False + +-1 == -3 = False +-1 == -2 = False +-1 == -1 = True +-1 == 0 = False +-1 == 1 = False +-1 == 2 = False +-1 == 3 = False + +0 == -3 = False +0 == -2 = False +0 == -1 = False +0 == 0 = True +0 == 1 = False +0 == 2 = False +0 == 3 = False + +1 == -3 = False +1 == -2 = False +1 == -1 = False +1 == 0 = False +1 == 1 = True +1 == 2 = False +1 == 3 = False + +2 == -3 = False +2 == -2 = False +2 == -1 = False +2 == 0 = False +2 == 1 = False +2 == 2 = True +2 == 3 = False + +3 == -3 = False +3 == -2 = False +3 == -1 = False +3 == 0 = False +3 == 1 = False +3 == 2 = False +3 == 3 = True + +# +-3 /= -3 = False +-3 /= -2 = True +-3 /= -1 = True +-3 /= 0 = True +-3 /= 1 = True +-3 /= 2 = True +-3 /= 3 = True + +-2 /= -3 = True +-2 /= -2 = False +-2 /= -1 = True +-2 /= 0 = True +-2 /= 1 = True +-2 /= 2 = True +-2 /= 3 = True + +-1 /= -3 = True +-1 /= -2 = True +-1 /= -1 = False +-1 /= 0 = True +-1 /= 1 = True +-1 /= 2 = True +-1 /= 3 = True + +0 /= -3 = True +0 /= -2 = True +0 /= -1 = True +0 /= 0 = False +0 /= 1 = True +0 /= 2 = True +0 /= 3 = True + +1 /= -3 = True +1 /= -2 = True +1 /= -1 = True +1 /= 0 = True +1 /= 1 = False +1 /= 2 = True +1 /= 3 = True + +2 /= -3 = True +2 /= -2 = True +2 /= -1 = True +2 /= 0 = True +2 /= 1 = True +2 /= 2 = False +2 /= 3 = True + +3 /= -3 = True +3 /= -2 = True +3 /= -1 = True +3 /= 0 = True +3 /= 1 = True +3 /= 2 = True +3 /= 3 = False + +# +testOrd +-3 <= -3 = True +-3 <= -2 = True +-3 <= -1 = True +-3 <= 0 = True +-3 <= 1 = True +-3 <= 2 = True +-3 <= 3 = True + +-2 <= -3 = False +-2 <= -2 = True +-2 <= -1 = True +-2 <= 0 = True +-2 <= 1 = True +-2 <= 2 = True +-2 <= 3 = True + +-1 <= -3 = False +-1 <= -2 = False +-1 <= -1 = True +-1 <= 0 = True +-1 <= 1 = True +-1 <= 2 = True +-1 <= 3 = True + +0 <= -3 = False +0 <= -2 = False +0 <= -1 = False +0 <= 0 = True +0 <= 1 = True +0 <= 2 = True +0 <= 3 = True + +1 <= -3 = False +1 <= -2 = False +1 <= -1 = False +1 <= 0 = False +1 <= 1 = True +1 <= 2 = True +1 <= 3 = True + +2 <= -3 = False +2 <= -2 = False +2 <= -1 = False +2 <= 0 = False +2 <= 1 = False +2 <= 2 = True +2 <= 3 = True + +3 <= -3 = False +3 <= -2 = False +3 <= -1 = False +3 <= 0 = False +3 <= 1 = False +3 <= 2 = False +3 <= 3 = True + +# +-3 < -3 = False +-3 < -2 = True +-3 < -1 = True +-3 < 0 = True +-3 < 1 = True +-3 < 2 = True +-3 < 3 = True + +-2 < -3 = False +-2 < -2 = False +-2 < -1 = True +-2 < 0 = True +-2 < 1 = True +-2 < 2 = True +-2 < 3 = True + +-1 < -3 = False +-1 < -2 = False +-1 < -1 = False +-1 < 0 = True +-1 < 1 = True +-1 < 2 = True +-1 < 3 = True + +0 < -3 = False +0 < -2 = False +0 < -1 = False +0 < 0 = False +0 < 1 = True +0 < 2 = True +0 < 3 = True + +1 < -3 = False +1 < -2 = False +1 < -1 = False +1 < 0 = False +1 < 1 = False +1 < 2 = True +1 < 3 = True + +2 < -3 = False +2 < -2 = False +2 < -1 = False +2 < 0 = False +2 < 1 = False +2 < 2 = False +2 < 3 = True + +3 < -3 = False +3 < -2 = False +3 < -1 = False +3 < 0 = False +3 < 1 = False +3 < 2 = False +3 < 3 = False + +# +-3 > -3 = False +-3 > -2 = False +-3 > -1 = False +-3 > 0 = False +-3 > 1 = False +-3 > 2 = False +-3 > 3 = False + +-2 > -3 = True +-2 > -2 = False +-2 > -1 = False +-2 > 0 = False +-2 > 1 = False +-2 > 2 = False +-2 > 3 = False + +-1 > -3 = True +-1 > -2 = True +-1 > -1 = False +-1 > 0 = False +-1 > 1 = False +-1 > 2 = False +-1 > 3 = False + +0 > -3 = True +0 > -2 = True +0 > -1 = True +0 > 0 = False +0 > 1 = False +0 > 2 = False +0 > 3 = False + +1 > -3 = True +1 > -2 = True +1 > -1 = True +1 > 0 = True +1 > 1 = False +1 > 2 = False +1 > 3 = False + +2 > -3 = True +2 > -2 = True +2 > -1 = True +2 > 0 = True +2 > 1 = True +2 > 2 = False +2 > 3 = False + +3 > -3 = True +3 > -2 = True +3 > -1 = True +3 > 0 = True +3 > 1 = True +3 > 2 = True +3 > 3 = False + +# +-3 >= -3 = True +-3 >= -2 = False +-3 >= -1 = False +-3 >= 0 = False +-3 >= 1 = False +-3 >= 2 = False +-3 >= 3 = False + +-2 >= -3 = True +-2 >= -2 = True +-2 >= -1 = False +-2 >= 0 = False +-2 >= 1 = False +-2 >= 2 = False +-2 >= 3 = False + +-1 >= -3 = True +-1 >= -2 = True +-1 >= -1 = True +-1 >= 0 = False +-1 >= 1 = False +-1 >= 2 = False +-1 >= 3 = False + +0 >= -3 = True +0 >= -2 = True +0 >= -1 = True +0 >= 0 = True +0 >= 1 = False +0 >= 2 = False +0 >= 3 = False + +1 >= -3 = True +1 >= -2 = True +1 >= -1 = True +1 >= 0 = True +1 >= 1 = True +1 >= 2 = False +1 >= 3 = False + +2 >= -3 = True +2 >= -2 = True +2 >= -1 = True +2 >= 0 = True +2 >= 1 = True +2 >= 2 = True +2 >= 3 = False + +3 >= -3 = True +3 >= -2 = True +3 >= -1 = True +3 >= 0 = True +3 >= 1 = True +3 >= 2 = True +3 >= 3 = True + +# +-3 `compare` -3 = EQ +-3 `compare` -2 = LT +-3 `compare` -1 = LT +-3 `compare` 0 = LT +-3 `compare` 1 = LT +-3 `compare` 2 = LT +-3 `compare` 3 = LT + +-2 `compare` -3 = GT +-2 `compare` -2 = EQ +-2 `compare` -1 = LT +-2 `compare` 0 = LT +-2 `compare` 1 = LT +-2 `compare` 2 = LT +-2 `compare` 3 = LT + +-1 `compare` -3 = GT +-1 `compare` -2 = GT +-1 `compare` -1 = EQ +-1 `compare` 0 = LT +-1 `compare` 1 = LT +-1 `compare` 2 = LT +-1 `compare` 3 = LT + +0 `compare` -3 = GT +0 `compare` -2 = GT +0 `compare` -1 = GT +0 `compare` 0 = EQ +0 `compare` 1 = LT +0 `compare` 2 = LT +0 `compare` 3 = LT + +1 `compare` -3 = GT +1 `compare` -2 = GT +1 `compare` -1 = GT +1 `compare` 0 = GT +1 `compare` 1 = EQ +1 `compare` 2 = LT +1 `compare` 3 = LT + +2 `compare` -3 = GT +2 `compare` -2 = GT +2 `compare` -1 = GT +2 `compare` 0 = GT +2 `compare` 1 = GT +2 `compare` 2 = EQ +2 `compare` 3 = LT + +3 `compare` -3 = GT +3 `compare` -2 = GT +3 `compare` -1 = GT +3 `compare` 0 = GT +3 `compare` 1 = GT +3 `compare` 2 = GT +3 `compare` 3 = EQ + +# +testNum +-3 + -3 = -6 +-3 + -2 = -5 +-3 + -1 = -4 +-3 + 0 = -3 +-3 + 1 = -2 +-3 + 2 = -1 +-3 + 3 = 0 + +-2 + -3 = -5 +-2 + -2 = -4 +-2 + -1 = -3 +-2 + 0 = -2 +-2 + 1 = -1 +-2 + 2 = 0 +-2 + 3 = 1 + +-1 + -3 = -4 +-1 + -2 = -3 +-1 + -1 = -2 +-1 + 0 = -1 +-1 + 1 = 0 +-1 + 2 = 1 +-1 + 3 = 2 + +0 + -3 = -3 +0 + -2 = -2 +0 + -1 = -1 +0 + 0 = 0 +0 + 1 = 1 +0 + 2 = 2 +0 + 3 = 3 + +1 + -3 = -2 +1 + -2 = -1 +1 + -1 = 0 +1 + 0 = 1 +1 + 1 = 2 +1 + 2 = 3 +1 + 3 = 4 + +2 + -3 = -1 +2 + -2 = 0 +2 + -1 = 1 +2 + 0 = 2 +2 + 1 = 3 +2 + 2 = 4 +2 + 3 = 5 + +3 + -3 = 0 +3 + -2 = 1 +3 + -1 = 2 +3 + 0 = 3 +3 + 1 = 4 +3 + 2 = 5 +3 + 3 = 6 + +# +-3 - -3 = 0 +-3 - -2 = -1 +-3 - -1 = -2 +-3 - 0 = -3 +-3 - 1 = -4 +-3 - 2 = -5 +-3 - 3 = -6 + +-2 - -3 = 1 +-2 - -2 = 0 +-2 - -1 = -1 +-2 - 0 = -2 +-2 - 1 = -3 +-2 - 2 = -4 +-2 - 3 = -5 + +-1 - -3 = 2 +-1 - -2 = 1 +-1 - -1 = 0 +-1 - 0 = -1 +-1 - 1 = -2 +-1 - 2 = -3 +-1 - 3 = -4 + +0 - -3 = 3 +0 - -2 = 2 +0 - -1 = 1 +0 - 0 = 0 +0 - 1 = -1 +0 - 2 = -2 +0 - 3 = -3 + +1 - -3 = 4 +1 - -2 = 3 +1 - -1 = 2 +1 - 0 = 1 +1 - 1 = 0 +1 - 2 = -1 +1 - 3 = -2 + +2 - -3 = 5 +2 - -2 = 4 +2 - -1 = 3 +2 - 0 = 2 +2 - 1 = 1 +2 - 2 = 0 +2 - 3 = -1 + +3 - -3 = 6 +3 - -2 = 5 +3 - -1 = 4 +3 - 0 = 3 +3 - 1 = 2 +3 - 2 = 1 +3 - 3 = 0 + +# +-3 * -3 = 9 +-3 * -2 = 6 +-3 * -1 = 3 +-3 * 0 = 0 +-3 * 1 = -3 +-3 * 2 = -6 +-3 * 3 = -9 + +-2 * -3 = 6 +-2 * -2 = 4 +-2 * -1 = 2 +-2 * 0 = 0 +-2 * 1 = -2 +-2 * 2 = -4 +-2 * 3 = -6 + +-1 * -3 = 3 +-1 * -2 = 2 +-1 * -1 = 1 +-1 * 0 = 0 +-1 * 1 = -1 +-1 * 2 = -2 +-1 * 3 = -3 + +0 * -3 = 0 +0 * -2 = 0 +0 * -1 = 0 +0 * 0 = 0 +0 * 1 = 0 +0 * 2 = 0 +0 * 3 = 0 + +1 * -3 = -3 +1 * -2 = -2 +1 * -1 = -1 +1 * 0 = 0 +1 * 1 = 1 +1 * 2 = 2 +1 * 3 = 3 + +2 * -3 = -6 +2 * -2 = -4 +2 * -1 = -2 +2 * 0 = 0 +2 * 1 = 2 +2 * 2 = 4 +2 * 3 = 6 + +3 * -3 = -9 +3 * -2 = -6 +3 * -1 = -3 +3 * 0 = 0 +3 * 1 = 3 +3 * 2 = 6 +3 * 3 = 9 + +# +negate -3 = 3 +negate -2 = 2 +negate -1 = 1 +negate 0 = 0 +negate 1 = -1 +negate 2 = -2 +negate 3 = -3 +# +testReal +toRational -3 = (-3) % 1 +toRational -2 = (-2) % 1 +toRational -1 = (-1) % 1 +toRational 0 = 0 % 1 +toRational 1 = 1 % 1 +toRational 2 = 2 % 1 +toRational 3 = 3 % 1 +# +testIntegral +-3 `divMod` -3 = (1,0) +-3 `divMod` -2 = (1,-1) +-3 `divMod` -1 = (3,0) +-3 `divMod` 0 = divide by zero +-3 `divMod` 1 = (-3,0) +-3 `divMod` 2 = (-2,1) +-3 `divMod` 3 = (-1,0) + +-2 `divMod` -3 = (0,-2) +-2 `divMod` -2 = (1,0) +-2 `divMod` -1 = (2,0) +-2 `divMod` 0 = divide by zero +-2 `divMod` 1 = (-2,0) +-2 `divMod` 2 = (-1,0) +-2 `divMod` 3 = (-1,1) + +-1 `divMod` -3 = (0,-1) +-1 `divMod` -2 = (0,-1) +-1 `divMod` -1 = (1,0) +-1 `divMod` 0 = divide by zero +-1 `divMod` 1 = (-1,0) +-1 `divMod` 2 = (-1,1) +-1 `divMod` 3 = (-1,2) + +0 `divMod` -3 = (0,0) +0 `divMod` -2 = (0,0) +0 `divMod` -1 = (0,0) +0 `divMod` 0 = divide by zero +0 `divMod` 1 = (0,0) +0 `divMod` 2 = (0,0) +0 `divMod` 3 = (0,0) + +1 `divMod` -3 = (-1,-2) +1 `divMod` -2 = (-1,-1) +1 `divMod` -1 = (-1,0) +1 `divMod` 0 = divide by zero +1 `divMod` 1 = (1,0) +1 `divMod` 2 = (0,1) +1 `divMod` 3 = (0,1) + +2 `divMod` -3 = (-1,-1) +2 `divMod` -2 = (-1,0) +2 `divMod` -1 = (-2,0) +2 `divMod` 0 = divide by zero +2 `divMod` 1 = (2,0) +2 `divMod` 2 = (1,0) +2 `divMod` 3 = (0,2) + +3 `divMod` -3 = (-1,0) +3 `divMod` -2 = (-2,-1) +3 `divMod` -1 = (-3,0) +3 `divMod` 0 = divide by zero +3 `divMod` 1 = (3,0) +3 `divMod` 2 = (1,1) +3 `divMod` 3 = (1,0) + +# +-3 `div` -3 = 1 +-3 `div` -2 = 1 +-3 `div` -1 = 3 +-3 `div` 0 = divide by zero +-3 `div` 1 = -3 +-3 `div` 2 = -2 +-3 `div` 3 = -1 + +-2 `div` -3 = 0 +-2 `div` -2 = 1 +-2 `div` -1 = 2 +-2 `div` 0 = divide by zero +-2 `div` 1 = -2 +-2 `div` 2 = -1 +-2 `div` 3 = -1 + +-1 `div` -3 = 0 +-1 `div` -2 = 0 +-1 `div` -1 = 1 +-1 `div` 0 = divide by zero +-1 `div` 1 = -1 +-1 `div` 2 = -1 +-1 `div` 3 = -1 + +0 `div` -3 = 0 +0 `div` -2 = 0 +0 `div` -1 = 0 +0 `div` 0 = divide by zero +0 `div` 1 = 0 +0 `div` 2 = 0 +0 `div` 3 = 0 + +1 `div` -3 = -1 +1 `div` -2 = -1 +1 `div` -1 = -1 +1 `div` 0 = divide by zero +1 `div` 1 = 1 +1 `div` 2 = 0 +1 `div` 3 = 0 + +2 `div` -3 = -1 +2 `div` -2 = -1 +2 `div` -1 = -2 +2 `div` 0 = divide by zero +2 `div` 1 = 2 +2 `div` 2 = 1 +2 `div` 3 = 0 + +3 `div` -3 = -1 +3 `div` -2 = -2 +3 `div` -1 = -3 +3 `div` 0 = divide by zero +3 `div` 1 = 3 +3 `div` 2 = 1 +3 `div` 3 = 1 + +# +-3 `mod` -3 = 0 +-3 `mod` -2 = -1 +-3 `mod` -1 = 0 +-3 `mod` 0 = divide by zero +-3 `mod` 1 = 0 +-3 `mod` 2 = 1 +-3 `mod` 3 = 0 + +-2 `mod` -3 = -2 +-2 `mod` -2 = 0 +-2 `mod` -1 = 0 +-2 `mod` 0 = divide by zero +-2 `mod` 1 = 0 +-2 `mod` 2 = 0 +-2 `mod` 3 = 1 + +-1 `mod` -3 = -1 +-1 `mod` -2 = -1 +-1 `mod` -1 = 0 +-1 `mod` 0 = divide by zero +-1 `mod` 1 = 0 +-1 `mod` 2 = 1 +-1 `mod` 3 = 2 + +0 `mod` -3 = 0 +0 `mod` -2 = 0 +0 `mod` -1 = 0 +0 `mod` 0 = divide by zero +0 `mod` 1 = 0 +0 `mod` 2 = 0 +0 `mod` 3 = 0 + +1 `mod` -3 = -2 +1 `mod` -2 = -1 +1 `mod` -1 = 0 +1 `mod` 0 = divide by zero +1 `mod` 1 = 0 +1 `mod` 2 = 1 +1 `mod` 3 = 1 + +2 `mod` -3 = -1 +2 `mod` -2 = 0 +2 `mod` -1 = 0 +2 `mod` 0 = divide by zero +2 `mod` 1 = 0 +2 `mod` 2 = 0 +2 `mod` 3 = 2 + +3 `mod` -3 = 0 +3 `mod` -2 = -1 +3 `mod` -1 = 0 +3 `mod` 0 = divide by zero +3 `mod` 1 = 0 +3 `mod` 2 = 1 +3 `mod` 3 = 0 + +# +-3 `quotRem` -3 = (1,0) +-3 `quotRem` -2 = (1,-1) +-3 `quotRem` -1 = (3,0) +-3 `quotRem` 0 = divide by zero +-3 `quotRem` 1 = (-3,0) +-3 `quotRem` 2 = (-1,-1) +-3 `quotRem` 3 = (-1,0) + +-2 `quotRem` -3 = (0,-2) +-2 `quotRem` -2 = (1,0) +-2 `quotRem` -1 = (2,0) +-2 `quotRem` 0 = divide by zero +-2 `quotRem` 1 = (-2,0) +-2 `quotRem` 2 = (-1,0) +-2 `quotRem` 3 = (0,-2) + +-1 `quotRem` -3 = (0,-1) +-1 `quotRem` -2 = (0,-1) +-1 `quotRem` -1 = (1,0) +-1 `quotRem` 0 = divide by zero +-1 `quotRem` 1 = (-1,0) +-1 `quotRem` 2 = (0,-1) +-1 `quotRem` 3 = (0,-1) + +0 `quotRem` -3 = (0,0) +0 `quotRem` -2 = (0,0) +0 `quotRem` -1 = (0,0) +0 `quotRem` 0 = divide by zero +0 `quotRem` 1 = (0,0) +0 `quotRem` 2 = (0,0) +0 `quotRem` 3 = (0,0) + +1 `quotRem` -3 = (0,1) +1 `quotRem` -2 = (0,1) +1 `quotRem` -1 = (-1,0) +1 `quotRem` 0 = divide by zero +1 `quotRem` 1 = (1,0) +1 `quotRem` 2 = (0,1) +1 `quotRem` 3 = (0,1) + +2 `quotRem` -3 = (0,2) +2 `quotRem` -2 = (-1,0) +2 `quotRem` -1 = (-2,0) +2 `quotRem` 0 = divide by zero +2 `quotRem` 1 = (2,0) +2 `quotRem` 2 = (1,0) +2 `quotRem` 3 = (0,2) + +3 `quotRem` -3 = (-1,0) +3 `quotRem` -2 = (-1,1) +3 `quotRem` -1 = (-3,0) +3 `quotRem` 0 = divide by zero +3 `quotRem` 1 = (3,0) +3 `quotRem` 2 = (1,1) +3 `quotRem` 3 = (1,0) + +# +-3 `quot` -3 = 1 +-3 `quot` -2 = 1 +-3 `quot` -1 = 3 +-3 `quot` 0 = divide by zero +-3 `quot` 1 = -3 +-3 `quot` 2 = -1 +-3 `quot` 3 = -1 + +-2 `quot` -3 = 0 +-2 `quot` -2 = 1 +-2 `quot` -1 = 2 +-2 `quot` 0 = divide by zero +-2 `quot` 1 = -2 +-2 `quot` 2 = -1 +-2 `quot` 3 = 0 + +-1 `quot` -3 = 0 +-1 `quot` -2 = 0 +-1 `quot` -1 = 1 +-1 `quot` 0 = divide by zero +-1 `quot` 1 = -1 +-1 `quot` 2 = 0 +-1 `quot` 3 = 0 + +0 `quot` -3 = 0 +0 `quot` -2 = 0 +0 `quot` -1 = 0 +0 `quot` 0 = divide by zero +0 `quot` 1 = 0 +0 `quot` 2 = 0 +0 `quot` 3 = 0 + +1 `quot` -3 = 0 +1 `quot` -2 = 0 +1 `quot` -1 = -1 +1 `quot` 0 = divide by zero +1 `quot` 1 = 1 +1 `quot` 2 = 0 +1 `quot` 3 = 0 + +2 `quot` -3 = 0 +2 `quot` -2 = -1 +2 `quot` -1 = -2 +2 `quot` 0 = divide by zero +2 `quot` 1 = 2 +2 `quot` 2 = 1 +2 `quot` 3 = 0 + +3 `quot` -3 = -1 +3 `quot` -2 = -1 +3 `quot` -1 = -3 +3 `quot` 0 = divide by zero +3 `quot` 1 = 3 +3 `quot` 2 = 1 +3 `quot` 3 = 1 + +# +-3 `rem` -3 = 0 +-3 `rem` -2 = -1 +-3 `rem` -1 = 0 +-3 `rem` 0 = divide by zero +-3 `rem` 1 = 0 +-3 `rem` 2 = -1 +-3 `rem` 3 = 0 + +-2 `rem` -3 = -2 +-2 `rem` -2 = 0 +-2 `rem` -1 = 0 +-2 `rem` 0 = divide by zero +-2 `rem` 1 = 0 +-2 `rem` 2 = 0 +-2 `rem` 3 = -2 + +-1 `rem` -3 = -1 +-1 `rem` -2 = -1 +-1 `rem` -1 = 0 +-1 `rem` 0 = divide by zero +-1 `rem` 1 = 0 +-1 `rem` 2 = -1 +-1 `rem` 3 = -1 + +0 `rem` -3 = 0 +0 `rem` -2 = 0 +0 `rem` -1 = 0 +0 `rem` 0 = divide by zero +0 `rem` 1 = 0 +0 `rem` 2 = 0 +0 `rem` 3 = 0 + +1 `rem` -3 = 1 +1 `rem` -2 = 1 +1 `rem` -1 = 0 +1 `rem` 0 = divide by zero +1 `rem` 1 = 0 +1 `rem` 2 = 1 +1 `rem` 3 = 1 + +2 `rem` -3 = 2 +2 `rem` -2 = 0 +2 `rem` -1 = 0 +2 `rem` 0 = divide by zero +2 `rem` 1 = 0 +2 `rem` 2 = 0 +2 `rem` 3 = 2 + +3 `rem` -3 = 0 +3 `rem` -2 = 1 +3 `rem` -1 = 0 +3 `rem` 0 = divide by zero +3 `rem` 1 = 0 +3 `rem` 2 = 1 +3 `rem` 3 = 0 + +# +testBits +-3 .&. -3 = -3 +-3 .&. -2 = -4 +-3 .&. -1 = -3 +-3 .&. 0 = 0 +-3 .&. 1 = 1 +-3 .&. 2 = 0 +-3 .&. 3 = 1 + +-2 .&. -3 = -4 +-2 .&. -2 = -2 +-2 .&. -1 = -2 +-2 .&. 0 = 0 +-2 .&. 1 = 0 +-2 .&. 2 = 2 +-2 .&. 3 = 2 + +-1 .&. -3 = -3 +-1 .&. -2 = -2 +-1 .&. -1 = -1 +-1 .&. 0 = 0 +-1 .&. 1 = 1 +-1 .&. 2 = 2 +-1 .&. 3 = 3 + +0 .&. -3 = 0 +0 .&. -2 = 0 +0 .&. -1 = 0 +0 .&. 0 = 0 +0 .&. 1 = 0 +0 .&. 2 = 0 +0 .&. 3 = 0 + +1 .&. -3 = 1 +1 .&. -2 = 0 +1 .&. -1 = 1 +1 .&. 0 = 0 +1 .&. 1 = 1 +1 .&. 2 = 0 +1 .&. 3 = 1 + +2 .&. -3 = 0 +2 .&. -2 = 2 +2 .&. -1 = 2 +2 .&. 0 = 0 +2 .&. 1 = 0 +2 .&. 2 = 2 +2 .&. 3 = 2 + +3 .&. -3 = 1 +3 .&. -2 = 2 +3 .&. -1 = 3 +3 .&. 0 = 0 +3 .&. 1 = 1 +3 .&. 2 = 2 +3 .&. 3 = 3 + +# +-3 .|. -3 = -3 +-3 .|. -2 = -1 +-3 .|. -1 = -1 +-3 .|. 0 = -3 +-3 .|. 1 = -3 +-3 .|. 2 = -1 +-3 .|. 3 = -1 + +-2 .|. -3 = -1 +-2 .|. -2 = -2 +-2 .|. -1 = -1 +-2 .|. 0 = -2 +-2 .|. 1 = -1 +-2 .|. 2 = -2 +-2 .|. 3 = -1 + +-1 .|. -3 = -1 +-1 .|. -2 = -1 +-1 .|. -1 = -1 +-1 .|. 0 = -1 +-1 .|. 1 = -1 +-1 .|. 2 = -1 +-1 .|. 3 = -1 + +0 .|. -3 = -3 +0 .|. -2 = -2 +0 .|. -1 = -1 +0 .|. 0 = 0 +0 .|. 1 = 1 +0 .|. 2 = 2 +0 .|. 3 = 3 + +1 .|. -3 = -3 +1 .|. -2 = -1 +1 .|. -1 = -1 +1 .|. 0 = 1 +1 .|. 1 = 1 +1 .|. 2 = 3 +1 .|. 3 = 3 + +2 .|. -3 = -1 +2 .|. -2 = -2 +2 .|. -1 = -1 +2 .|. 0 = 2 +2 .|. 1 = 3 +2 .|. 2 = 2 +2 .|. 3 = 3 + +3 .|. -3 = -1 +3 .|. -2 = -1 +3 .|. -1 = -1 +3 .|. 0 = 3 +3 .|. 1 = 3 +3 .|. 2 = 3 +3 .|. 3 = 3 + +# +-3 `xor` -3 = 0 +-3 `xor` -2 = 3 +-3 `xor` -1 = 2 +-3 `xor` 0 = -3 +-3 `xor` 1 = -4 +-3 `xor` 2 = -1 +-3 `xor` 3 = -2 + +-2 `xor` -3 = 3 +-2 `xor` -2 = 0 +-2 `xor` -1 = 1 +-2 `xor` 0 = -2 +-2 `xor` 1 = -1 +-2 `xor` 2 = -4 +-2 `xor` 3 = -3 + +-1 `xor` -3 = 2 +-1 `xor` -2 = 1 +-1 `xor` -1 = 0 +-1 `xor` 0 = -1 +-1 `xor` 1 = -2 +-1 `xor` 2 = -3 +-1 `xor` 3 = -4 + +0 `xor` -3 = -3 +0 `xor` -2 = -2 +0 `xor` -1 = -1 +0 `xor` 0 = 0 +0 `xor` 1 = 1 +0 `xor` 2 = 2 +0 `xor` 3 = 3 + +1 `xor` -3 = -4 +1 `xor` -2 = -1 +1 `xor` -1 = -2 +1 `xor` 0 = 1 +1 `xor` 1 = 0 +1 `xor` 2 = 3 +1 `xor` 3 = 2 + +2 `xor` -3 = -1 +2 `xor` -2 = -4 +2 `xor` -1 = -3 +2 `xor` 0 = 2 +2 `xor` 1 = 3 +2 `xor` 2 = 0 +2 `xor` 3 = 1 + +3 `xor` -3 = -2 +3 `xor` -2 = -3 +3 `xor` -1 = -4 +3 `xor` 0 = 3 +3 `xor` 1 = 2 +3 `xor` 2 = 1 +3 `xor` 3 = 0 + +# +complement -3 = 2 +complement -2 = 1 +complement -1 = 0 +complement 0 = -1 +complement 1 = -2 +complement 2 = -3 +complement 3 = -4 +# +-3 `shiftL` 0 = -3 +-3 `shiftL` 1 = -6 +-3 `shiftL` 2 = -12 +-3 `shiftL` 3 = -24 +-3 `shiftL` 32 = -12884901888 +-3 `shiftL` 64 = -55340232221128654848 + +-2 `shiftL` 0 = -2 +-2 `shiftL` 1 = -4 +-2 `shiftL` 2 = -8 +-2 `shiftL` 3 = -16 +-2 `shiftL` 32 = -8589934592 +-2 `shiftL` 64 = -36893488147419103232 + +-1 `shiftL` 0 = -1 +-1 `shiftL` 1 = -2 +-1 `shiftL` 2 = -4 +-1 `shiftL` 3 = -8 +-1 `shiftL` 32 = -4294967296 +-1 `shiftL` 64 = -18446744073709551616 + +0 `shiftL` 0 = 0 +0 `shiftL` 1 = 0 +0 `shiftL` 2 = 0 +0 `shiftL` 3 = 0 +0 `shiftL` 32 = 0 +0 `shiftL` 64 = 0 + +1 `shiftL` 0 = 1 +1 `shiftL` 1 = 2 +1 `shiftL` 2 = 4 +1 `shiftL` 3 = 8 +1 `shiftL` 32 = 4294967296 +1 `shiftL` 64 = 18446744073709551616 + +2 `shiftL` 0 = 2 +2 `shiftL` 1 = 4 +2 `shiftL` 2 = 8 +2 `shiftL` 3 = 16 +2 `shiftL` 32 = 8589934592 +2 `shiftL` 64 = 36893488147419103232 + +3 `shiftL` 0 = 3 +3 `shiftL` 1 = 6 +3 `shiftL` 2 = 12 +3 `shiftL` 3 = 24 +3 `shiftL` 32 = 12884901888 +3 `shiftL` 64 = 55340232221128654848 + +# +-3 `shiftR` 0 = -3 +-3 `shiftR` 1 = -2 +-3 `shiftR` 2 = -1 +-3 `shiftR` 3 = -1 +-3 `shiftR` 32 = -1 +-3 `shiftR` 64 = -1 + +-2 `shiftR` 0 = -2 +-2 `shiftR` 1 = -1 +-2 `shiftR` 2 = -1 +-2 `shiftR` 3 = -1 +-2 `shiftR` 32 = -1 +-2 `shiftR` 64 = -1 + +-1 `shiftR` 0 = -1 +-1 `shiftR` 1 = -1 +-1 `shiftR` 2 = -1 +-1 `shiftR` 3 = -1 +-1 `shiftR` 32 = -1 +-1 `shiftR` 64 = -1 + +0 `shiftR` 0 = 0 +0 `shiftR` 1 = 0 +0 `shiftR` 2 = 0 +0 `shiftR` 3 = 0 +0 `shiftR` 32 = 0 +0 `shiftR` 64 = 0 + +1 `shiftR` 0 = 1 +1 `shiftR` 1 = 0 +1 `shiftR` 2 = 0 +1 `shiftR` 3 = 0 +1 `shiftR` 32 = 0 +1 `shiftR` 64 = 0 + +2 `shiftR` 0 = 2 +2 `shiftR` 1 = 1 +2 `shiftR` 2 = 0 +2 `shiftR` 3 = 0 +2 `shiftR` 32 = 0 +2 `shiftR` 64 = 0 + +3 `shiftR` 0 = 3 +3 `shiftR` 1 = 1 +3 `shiftR` 2 = 0 +3 `shiftR` 3 = 0 +3 `shiftR` 32 = 0 +3 `shiftR` 64 = 0 + +# +-3 `rotate` -3 = -1 +-3 `rotate` -2 = -1 +-3 `rotate` -1 = -2 +-3 `rotate` 0 = -3 +-3 `rotate` 1 = -6 +-3 `rotate` 2 = -12 +-3 `rotate` 3 = -24 +-3 `rotate` -64 = -1 +-3 `rotate` -32 = -1 +-3 `rotate` 32 = -12884901888 +-3 `rotate` 64 = -55340232221128654848 + +-2 `rotate` -3 = -1 +-2 `rotate` -2 = -1 +-2 `rotate` -1 = -1 +-2 `rotate` 0 = -2 +-2 `rotate` 1 = -4 +-2 `rotate` 2 = -8 +-2 `rotate` 3 = -16 +-2 `rotate` -64 = -1 +-2 `rotate` -32 = -1 +-2 `rotate` 32 = -8589934592 +-2 `rotate` 64 = -36893488147419103232 + +-1 `rotate` -3 = -1 +-1 `rotate` -2 = -1 +-1 `rotate` -1 = -1 +-1 `rotate` 0 = -1 +-1 `rotate` 1 = -2 +-1 `rotate` 2 = -4 +-1 `rotate` 3 = -8 +-1 `rotate` -64 = -1 +-1 `rotate` -32 = -1 +-1 `rotate` 32 = -4294967296 +-1 `rotate` 64 = -18446744073709551616 + +0 `rotate` -3 = 0 +0 `rotate` -2 = 0 +0 `rotate` -1 = 0 +0 `rotate` 0 = 0 +0 `rotate` 1 = 0 +0 `rotate` 2 = 0 +0 `rotate` 3 = 0 +0 `rotate` -64 = 0 +0 `rotate` -32 = 0 +0 `rotate` 32 = 0 +0 `rotate` 64 = 0 + +1 `rotate` -3 = 0 +1 `rotate` -2 = 0 +1 `rotate` -1 = 0 +1 `rotate` 0 = 1 +1 `rotate` 1 = 2 +1 `rotate` 2 = 4 +1 `rotate` 3 = 8 +1 `rotate` -64 = 0 +1 `rotate` -32 = 0 +1 `rotate` 32 = 4294967296 +1 `rotate` 64 = 18446744073709551616 + +2 `rotate` -3 = 0 +2 `rotate` -2 = 0 +2 `rotate` -1 = 1 +2 `rotate` 0 = 2 +2 `rotate` 1 = 4 +2 `rotate` 2 = 8 +2 `rotate` 3 = 16 +2 `rotate` -64 = 0 +2 `rotate` -32 = 0 +2 `rotate` 32 = 8589934592 +2 `rotate` 64 = 36893488147419103232 + +3 `rotate` -3 = 0 +3 `rotate` -2 = 0 +3 `rotate` -1 = 1 +3 `rotate` 0 = 3 +3 `rotate` 1 = 6 +3 `rotate` 2 = 12 +3 `rotate` 3 = 24 +3 `rotate` -64 = 0 +3 `rotate` -32 = 0 +3 `rotate` 32 = 12884901888 +3 `rotate` 64 = 55340232221128654848 + +# +bit 0 = 1 +bit 1 = 2 +bit 2 = 4 +bit 3 = 8 +# +-3 `setBit` 0 = -3 +-3 `setBit` 1 = -1 +-3 `setBit` 2 = -3 +-3 `setBit` 3 = -3 +-3 `setBit` 32 = -3 +-3 `setBit` 64 = -3 + +-2 `setBit` 0 = -1 +-2 `setBit` 1 = -2 +-2 `setBit` 2 = -2 +-2 `setBit` 3 = -2 +-2 `setBit` 32 = -2 +-2 `setBit` 64 = -2 + +-1 `setBit` 0 = -1 +-1 `setBit` 1 = -1 +-1 `setBit` 2 = -1 +-1 `setBit` 3 = -1 +-1 `setBit` 32 = -1 +-1 `setBit` 64 = -1 + +0 `setBit` 0 = 1 +0 `setBit` 1 = 2 +0 `setBit` 2 = 4 +0 `setBit` 3 = 8 +0 `setBit` 32 = 4294967296 +0 `setBit` 64 = 18446744073709551616 + +1 `setBit` 0 = 1 +1 `setBit` 1 = 3 +1 `setBit` 2 = 5 +1 `setBit` 3 = 9 +1 `setBit` 32 = 4294967297 +1 `setBit` 64 = 18446744073709551617 + +2 `setBit` 0 = 3 +2 `setBit` 1 = 2 +2 `setBit` 2 = 6 +2 `setBit` 3 = 10 +2 `setBit` 32 = 4294967298 +2 `setBit` 64 = 18446744073709551618 + +3 `setBit` 0 = 3 +3 `setBit` 1 = 3 +3 `setBit` 2 = 7 +3 `setBit` 3 = 11 +3 `setBit` 32 = 4294967299 +3 `setBit` 64 = 18446744073709551619 + +# +-3 `clearBit` 0 = -4 +-3 `clearBit` 1 = -3 +-3 `clearBit` 2 = -7 +-3 `clearBit` 3 = -11 +-3 `clearBit` 32 = -4294967299 +-3 `clearBit` 64 = -18446744073709551619 + +-2 `clearBit` 0 = -2 +-2 `clearBit` 1 = -4 +-2 `clearBit` 2 = -6 +-2 `clearBit` 3 = -10 +-2 `clearBit` 32 = -4294967298 +-2 `clearBit` 64 = -18446744073709551618 + +-1 `clearBit` 0 = -2 +-1 `clearBit` 1 = -3 +-1 `clearBit` 2 = -5 +-1 `clearBit` 3 = -9 +-1 `clearBit` 32 = -4294967297 +-1 `clearBit` 64 = -18446744073709551617 + +0 `clearBit` 0 = 0 +0 `clearBit` 1 = 0 +0 `clearBit` 2 = 0 +0 `clearBit` 3 = 0 +0 `clearBit` 32 = 0 +0 `clearBit` 64 = 0 + +1 `clearBit` 0 = 0 +1 `clearBit` 1 = 1 +1 `clearBit` 2 = 1 +1 `clearBit` 3 = 1 +1 `clearBit` 32 = 1 +1 `clearBit` 64 = 1 + +2 `clearBit` 0 = 2 +2 `clearBit` 1 = 0 +2 `clearBit` 2 = 2 +2 `clearBit` 3 = 2 +2 `clearBit` 32 = 2 +2 `clearBit` 64 = 2 + +3 `clearBit` 0 = 2 +3 `clearBit` 1 = 1 +3 `clearBit` 2 = 3 +3 `clearBit` 3 = 3 +3 `clearBit` 32 = 3 +3 `clearBit` 64 = 3 + +# +-3 `complementBit` 0 = -4 +-3 `complementBit` 1 = -1 +-3 `complementBit` 2 = -7 +-3 `complementBit` 3 = -11 +-3 `complementBit` 32 = -4294967299 +-3 `complementBit` 64 = -18446744073709551619 + +-2 `complementBit` 0 = -1 +-2 `complementBit` 1 = -4 +-2 `complementBit` 2 = -6 +-2 `complementBit` 3 = -10 +-2 `complementBit` 32 = -4294967298 +-2 `complementBit` 64 = -18446744073709551618 + +-1 `complementBit` 0 = -2 +-1 `complementBit` 1 = -3 +-1 `complementBit` 2 = -5 +-1 `complementBit` 3 = -9 +-1 `complementBit` 32 = -4294967297 +-1 `complementBit` 64 = -18446744073709551617 + +0 `complementBit` 0 = 1 +0 `complementBit` 1 = 2 +0 `complementBit` 2 = 4 +0 `complementBit` 3 = 8 +0 `complementBit` 32 = 4294967296 +0 `complementBit` 64 = 18446744073709551616 + +1 `complementBit` 0 = 0 +1 `complementBit` 1 = 3 +1 `complementBit` 2 = 5 +1 `complementBit` 3 = 9 +1 `complementBit` 32 = 4294967297 +1 `complementBit` 64 = 18446744073709551617 + +2 `complementBit` 0 = 3 +2 `complementBit` 1 = 0 +2 `complementBit` 2 = 6 +2 `complementBit` 3 = 10 +2 `complementBit` 32 = 4294967298 +2 `complementBit` 64 = 18446744073709551618 + +3 `complementBit` 0 = 2 +3 `complementBit` 1 = 1 +3 `complementBit` 2 = 7 +3 `complementBit` 3 = 11 +3 `complementBit` 32 = 4294967299 +3 `complementBit` 64 = 18446744073709551619 + +# +-3 `testBit` 0 = True +-3 `testBit` 1 = False +-3 `testBit` 2 = True +-3 `testBit` 3 = True +-3 `testBit` 32 = True +-3 `testBit` 64 = True + +-2 `testBit` 0 = False +-2 `testBit` 1 = True +-2 `testBit` 2 = True +-2 `testBit` 3 = True +-2 `testBit` 32 = True +-2 `testBit` 64 = True + +-1 `testBit` 0 = True +-1 `testBit` 1 = True +-1 `testBit` 2 = True +-1 `testBit` 3 = True +-1 `testBit` 32 = True +-1 `testBit` 64 = True + +0 `testBit` 0 = False +0 `testBit` 1 = False +0 `testBit` 2 = False +0 `testBit` 3 = False +0 `testBit` 32 = False +0 `testBit` 64 = False + +1 `testBit` 0 = True +1 `testBit` 1 = False +1 `testBit` 2 = False +1 `testBit` 3 = False +1 `testBit` 32 = False +1 `testBit` 64 = False + +2 `testBit` 0 = False +2 `testBit` 1 = True +2 `testBit` 2 = False +2 `testBit` 3 = False +2 `testBit` 32 = False +2 `testBit` 64 = False + +3 `testBit` 0 = True +3 `testBit` 1 = True +3 `testBit` 2 = False +3 `testBit` 3 = False +3 `testBit` 32 = False +3 `testBit` 64 = False + +# +isSigned -3 = True +isSigned -2 = True +isSigned -1 = True +isSigned 0 = True +isSigned 1 = True +isSigned 2 = True +isSigned 3 = True +# diff --git a/testsuite/tests/numeric/should_run/arith012.hs b/testsuite/tests/numeric/should_run/arith012.hs new file mode 100644 index 0000000000..f9f9ec778e --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith012.hs @@ -0,0 +1,90 @@ +-- !!! Testing NumExts +module Main(main) where + +import Numeric +import Data.Char + +main :: IO () +main = tst + +tst :: IO () +tst = do + test_doubleToFloat + test_floatToDouble + test_showHex + test_showOct + test_showBin + +---- +-- Test data: +doubles :: [Double] +doubles = [ -1.2 , 0, 0.1, 0.5, 1.0, 1234.45454, + 1.6053e4, 1.64022e12, 6.894e-4, 6.34543455634582173, + 5342413403.40540423255] +ints :: [Int] +ints = [ 0, 1, 255, 65513, 6029, 1024, 256, 201357245] + +integers :: [Integer] +integers = [ 0, 1, 255, 65513, 6029, 1024, 256, + 2343243543500233, 656194962055457832] +--- + +test_doubleToFloat :: IO () +test_doubleToFloat = do + test_banner "doubleToFloat" + putStrLn (show doubles) + putStrLn (show $ map doubleToFloat doubles) + +doubleToFloat :: Double -> Float +doubleToFloat = realToFrac + +floatToDouble :: Float -> Double +floatToDouble = realToFrac + +test_floatToDouble :: IO () +test_floatToDouble = do + test_banner "doubleToFloat" + putStrLn (show doubles) + putStrLn (show $ map doubleToFloat doubles) + putStrLn (show $ map (floatToDouble.doubleToFloat) doubles) + +test_showHex :: IO () +test_showHex = do + test_banner "showHex" + putStrLn (show ints) + putStrLn (showList' (map showHex ints)) + putStrLn (show integers) + putStrLn (showList' (map showHex integers)) + +test_showBin :: IO () +test_showBin = do + test_banner "showBin" + putStrLn (show ints) + putStrLn (showList' (map showBin ints)) + putStrLn (show integers) + putStrLn (showList' (map showBin integers)) + +showBin i = showIntAtBase 2 intToDigit i + +showList' :: [ShowS] -> String +showList' [] = "[]" +showList' (x:xs) = showChar '[' . x $ showl xs "" + where + showl [] = showChar ']' + showl (x:xs) = showChar ',' . x . showl xs + + +test_showOct :: IO () +test_showOct = do + test_banner "showOct" + putStrLn (show ints) + putStrLn (showList' (map showOct ints)) + putStrLn (show integers) + putStrLn (showList' (map showOct integers)) + +---- +test_banner :: String -> IO () +test_banner tst = do + putStrLn $ "--------------------------------" + putStrLn $ "--Testing " ++ tst + putStrLn $ "--------------------------------" diff --git a/testsuite/tests/numeric/should_run/arith012.stdout b/testsuite/tests/numeric/should_run/arith012.stdout new file mode 100644 index 0000000000..c1c38c7f5a --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith012.stdout @@ -0,0 +1,32 @@ +-------------------------------- +--Testing doubleToFloat +-------------------------------- +[-1.2,0.0,0.1,0.5,1.0,1234.45454,16053.0,1.64022e12,6.894e-4,6.345434556345822,5.342413403405404e9] +[-1.2,0.0,0.1,0.5,1.0,1234.4546,16053.0,1.64022e12,6.894e-4,6.3454347,5.3424133e9] +-------------------------------- +--Testing doubleToFloat +-------------------------------- +[-1.2,0.0,0.1,0.5,1.0,1234.45454,16053.0,1.64022e12,6.894e-4,6.345434556345822,5.342413403405404e9] +[-1.2,0.0,0.1,0.5,1.0,1234.4546,16053.0,1.64022e12,6.894e-4,6.3454347,5.3424133e9] +[-1.2000000476837158,0.0,0.10000000149011612,0.5,1.0,1234.45458984375,16053.0,1.64021993472e12,6.894000107422471e-4,6.345434665679932,5.342413312e9] +-------------------------------- +--Testing showHex +-------------------------------- +[0,1,255,65513,6029,1024,256,201357245] +[0,1,ff,ffe9,178d,400,100,c0077bd] +[0,1,255,65513,6029,1024,256,2343243543500233,656194962055457832] +[0,1,ff,ffe9,178d,400,100,8532ae70855c9,91b45d760b76c28] +-------------------------------- +--Testing showOct +-------------------------------- +[0,1,255,65513,6029,1024,256,201357245] +[0,1,377,177751,13615,2000,400,1400073675] +[0,1,255,65513,6029,1024,256,2343243543500233,656194962055457832] +[0,1,377,177751,13615,2000,400,102462534702052711,44332135354055666050] +-------------------------------- +--Testing showBin +-------------------------------- +[0,1,255,65513,6029,1024,256,201357245] +[0,1,11111111,1111111111101001,1011110001101,10000000000,100000000,1100000000000111011110111101] +[0,1,255,65513,6029,1024,256,2343243543500233,656194962055457832] +[0,1,11111111,1111111111101001,1011110001101,10000000000,100000000,1000010100110010101011100111000010000101010111001001,100100011011010001011101011101100000101101110110110000101000] diff --git a/testsuite/tests/numeric/should_run/arith013.hs b/testsuite/tests/numeric/should_run/arith013.hs new file mode 100644 index 0000000000..a03cbb3795 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith013.hs @@ -0,0 +1,13 @@ +-- Test gcdInt/gcdInteger + +import GHC.Real ( gcdInt ) +import GHC.Num ( gcdInteger ) + +main :: IO () +main = do + test gcdInt [ -42, 0, 105 ] + test gcdInteger [-12193263111263526900, -42, 0, 105, 1234567890 ] + + +test :: Integral a => (a -> a -> a) -> [a] -> IO () +test f xs = mapM_ print [ (a, b, f a b) | a <- xs, b <- reverse xs, a /= 0 || b /= 0 ] diff --git a/testsuite/tests/numeric/should_run/arith013.stdout b/testsuite/tests/numeric/should_run/arith013.stdout new file mode 100644 index 0000000000..ff440977df --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith013.stdout @@ -0,0 +1,32 @@ +(-42,105,21) +(-42,0,42) +(-42,-42,42) +(0,105,105) +(0,-42,42) +(105,105,105) +(105,0,105) +(105,-42,21) +(-12193263111263526900,1234567890,1234567890) +(-12193263111263526900,105,15) +(-12193263111263526900,0,12193263111263526900) +(-12193263111263526900,-42,6) +(-12193263111263526900,-12193263111263526900,12193263111263526900) +(-42,1234567890,6) +(-42,105,21) +(-42,0,42) +(-42,-42,42) +(-42,-12193263111263526900,6) +(0,1234567890,1234567890) +(0,105,105) +(0,-42,42) +(0,-12193263111263526900,12193263111263526900) +(105,1234567890,15) +(105,105,105) +(105,0,105) +(105,-42,21) +(105,-12193263111263526900,15) +(1234567890,1234567890,1234567890) +(1234567890,105,15) +(1234567890,0,1234567890) +(1234567890,-42,6) +(1234567890,-12193263111263526900,1234567890) diff --git a/testsuite/tests/numeric/should_run/arith014.hs b/testsuite/tests/numeric/should_run/arith014.hs new file mode 100644 index 0000000000..92fc362ee8 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith014.hs @@ -0,0 +1,11 @@ +-- Test behaviour of fromInteger when the target type is out of range. + +main :: IO () +main = + print [ + fromInteger maxInt2 :: Int, + fromInteger minInt2 :: Int + ] + +maxInt2 = fromIntegral (maxBound :: Int) * 2 :: Integer +minInt2 = fromIntegral (minBound + 1 :: Int) * 2 :: Integer diff --git a/testsuite/tests/numeric/should_run/arith014.stdout b/testsuite/tests/numeric/should_run/arith014.stdout new file mode 100644 index 0000000000..9716a9fa88 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith014.stdout @@ -0,0 +1 @@ +[-2,2] diff --git a/testsuite/tests/numeric/should_run/arith015.hs b/testsuite/tests/numeric/should_run/arith015.hs new file mode 100644 index 0000000000..c1e58c0540 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith015.hs @@ -0,0 +1,5 @@ +main = do + print (map read strange_nums :: [Float]) + print (map read strange_nums :: [Double]) + where + strange_nums = ["Infinity","NaN", "-Infinity"] diff --git a/testsuite/tests/numeric/should_run/arith015.stdout b/testsuite/tests/numeric/should_run/arith015.stdout new file mode 100644 index 0000000000..f5f8416a6b --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith015.stdout @@ -0,0 +1,2 @@ +[Infinity,NaN,-Infinity] +[Infinity,NaN,-Infinity] diff --git a/testsuite/tests/numeric/should_run/arith016.hs b/testsuite/tests/numeric/should_run/arith016.hs new file mode 100644 index 0000000000..1437b8799d --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith016.hs @@ -0,0 +1,33 @@ +{-# LANGUAGE MagicHash #-} + +module Main where + +import GHC.Exts ( Float(F#), + eqFloat#, neFloat#, ltFloat#, + leFloat#, gtFloat#, geFloat# + ) + +fcmp_eq, fcmp_ne, fcmp_lt, fcmp_le, fcmp_gt, fcmp_ge :: (String, Float -> Float -> Bool) +fcmp_eq = ("==", \ (F# a) (F# b) -> a `eqFloat#` b) +fcmp_ne = ("/=", \ (F# a) (F# b) -> a `neFloat#` b) +fcmp_lt = ("< ", \ (F# a) (F# b) -> a `ltFloat#` b) +fcmp_le = ("<=", \ (F# a) (F# b) -> a `leFloat#` b) +fcmp_gt = ("> ", \ (F# a) (F# b) -> a `gtFloat#` b) +fcmp_ge = (">=", \ (F# a) (F# b) -> a `geFloat#` b) + +float_fns = [fcmp_eq, fcmp_ne, fcmp_lt, fcmp_le, fcmp_gt, fcmp_ge] + +float_vals :: [Float] +float_vals = [0.0, 1.0, read "NaN"] + +float_text + = [show4 arg1 ++ " " ++ fn_name ++ " " ++ show4 arg2 ++ " = " ++ show (fn arg1 arg2) + | (fn_name, fn) <- float_fns, + arg1 <- float_vals, + arg2 <- float_vals + ] + where + show4 x = take 4 (show x ++ repeat ' ') + +main + = putStrLn (unlines float_text) diff --git a/testsuite/tests/numeric/should_run/arith016.stdout b/testsuite/tests/numeric/should_run/arith016.stdout new file mode 100644 index 0000000000..5361a8e0bd --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith016.stdout @@ -0,0 +1,55 @@ +0.0 == 0.0 = True +0.0 == 1.0 = False +0.0 == NaN = False +1.0 == 0.0 = False +1.0 == 1.0 = True +1.0 == NaN = False +NaN == 0.0 = False +NaN == 1.0 = False +NaN == NaN = False +0.0 /= 0.0 = False +0.0 /= 1.0 = True +0.0 /= NaN = True +1.0 /= 0.0 = True +1.0 /= 1.0 = False +1.0 /= NaN = True +NaN /= 0.0 = True +NaN /= 1.0 = True +NaN /= NaN = True +0.0 < 0.0 = False +0.0 < 1.0 = True +0.0 < NaN = False +1.0 < 0.0 = False +1.0 < 1.0 = False +1.0 < NaN = False +NaN < 0.0 = False +NaN < 1.0 = False +NaN < NaN = False +0.0 <= 0.0 = True +0.0 <= 1.0 = True +0.0 <= NaN = False +1.0 <= 0.0 = False +1.0 <= 1.0 = True +1.0 <= NaN = False +NaN <= 0.0 = False +NaN <= 1.0 = False +NaN <= NaN = False +0.0 > 0.0 = False +0.0 > 1.0 = False +0.0 > NaN = False +1.0 > 0.0 = True +1.0 > 1.0 = False +1.0 > NaN = False +NaN > 0.0 = False +NaN > 1.0 = False +NaN > NaN = False +0.0 >= 0.0 = True +0.0 >= 1.0 = False +0.0 >= NaN = False +1.0 >= 0.0 = True +1.0 >= 1.0 = True +1.0 >= NaN = False +NaN >= 0.0 = False +NaN >= 1.0 = False +NaN >= NaN = False + diff --git a/testsuite/tests/numeric/should_run/arith017.hs b/testsuite/tests/numeric/should_run/arith017.hs new file mode 100644 index 0000000000..86048dcbe3 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith017.hs @@ -0,0 +1,10 @@ +-- !!! test for a bug in integer->{Int,Word}64 conversion in GHC 5.04.x + +import Data.Int +import Data.Word + +main = do + print (fromIntegral ((2^30 -1 + 2^30) - (2^30 + 2^30 :: Integer)) + :: Data.Int.Int64) + print (fromIntegral ((2^30 -1 + 2^30) - (2^30 + 2^30 :: Integer)) + :: Data.Word.Word64) diff --git a/testsuite/tests/numeric/should_run/arith017.stdout b/testsuite/tests/numeric/should_run/arith017.stdout new file mode 100644 index 0000000000..b234817560 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith017.stdout @@ -0,0 +1,2 @@ +-1 +18446744073709551615 diff --git a/testsuite/tests/numeric/should_run/arith018.hs b/testsuite/tests/numeric/should_run/arith018.hs new file mode 100644 index 0000000000..b73fd5a685 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith018.hs @@ -0,0 +1,12 @@ +-- exposes a bug in the native code generator in GHC 6.4.1. Division by +-- a power of 2 was being mis-optimsed to a direct shift. + +main = do + print (map f4 [(-20) .. (-1)]) + print (map f8 [(-20) .. (-1)]) + +f4 :: Int -> Int +f4 x = x `quot` 4 + +f8 :: Int -> Int +f8 x = x `quot` 8 diff --git a/testsuite/tests/numeric/should_run/arith018.stdout b/testsuite/tests/numeric/should_run/arith018.stdout new file mode 100644 index 0000000000..21f7af65f9 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith018.stdout @@ -0,0 +1,2 @@ +[-5,-4,-4,-4,-4,-3,-3,-3,-3,-2,-2,-2,-2,-1,-1,-1,-1,0,0,0] +[-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0] diff --git a/testsuite/tests/numeric/should_run/arith019.hs b/testsuite/tests/numeric/should_run/arith019.hs new file mode 100644 index 0000000000..861e9bc883 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith019.hs @@ -0,0 +1,10 @@ +-- demonstrates a bug in mulIntMayOflo in GHC 6.5 on 64-bit arches +-- (trac #867). +-- It thought it could represent 3049800625 * 3049800625 in an I#. + +i :: Integer +i = 3049800625 + +main :: IO () +main = print (i * i) + diff --git a/testsuite/tests/numeric/should_run/arith019.stdout b/testsuite/tests/numeric/should_run/arith019.stdout new file mode 100644 index 0000000000..3830f20e11 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith019.stdout @@ -0,0 +1 @@ +9301283852250390625 diff --git a/testsuite/tests/numeric/should_run/expfloat.hs b/testsuite/tests/numeric/should_run/expfloat.hs new file mode 100644 index 0000000000..fffa83d8f1 --- /dev/null +++ b/testsuite/tests/numeric/should_run/expfloat.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE MagicHash #-} +-- tests that expFloat# works (had linking problems on Windows) + +import GHC.Exts + +main = do + print (F# (expFloat# 3.45#)) diff --git a/testsuite/tests/numeric/should_run/expfloat.stdout b/testsuite/tests/numeric/should_run/expfloat.stdout new file mode 100644 index 0000000000..50eee0c4d6 --- /dev/null +++ b/testsuite/tests/numeric/should_run/expfloat.stdout @@ -0,0 +1 @@ +31.500393 diff --git a/testsuite/tests/numeric/should_run/numrun009.hs b/testsuite/tests/numeric/should_run/numrun009.hs new file mode 100644 index 0000000000..37d0513a39 --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun009.hs @@ -0,0 +1,17 @@ +-- !!! tests that minBound::Int is correctly handled (for Int & Integer + +-- (not necessarily Haskell 98: relies on Int being a 32-bit type.) + +main = do + print (-2147483648 :: Int) -- -2147483648 + print ((-2147483647)-1 :: Int) -- -2147483648 + print (-2147483648 :: Integer) -- -2147483648 + print ((-2147483648 :: Int) >= 0) -- False + print ((-2147483648 :: Integer) >= 0) -- False + print (-(-2147483648) :: Int) -- <undefined> + print (abs (-2147483648) :: Int) -- <undefined> + print (abs ((-2147483647)-1) :: Int) -- <undefined> + print (abs (-2147483648) :: Integer) -- 2147483648 + print (abs ((-2147483647)-1) :: Integer) -- 2147483648 (wrong in 4.04) + print (fromInteger (-2147483648 :: Integer) :: Int) -- -2147483648 + print (fromInteger ((-2147483647)-1 :: Integer) :: Int) -- -2147483648 diff --git a/testsuite/tests/numeric/should_run/numrun009.stdout b/testsuite/tests/numeric/should_run/numrun009.stdout new file mode 100644 index 0000000000..902e36915d --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun009.stdout @@ -0,0 +1,12 @@ +-2147483648 +-2147483648 +-2147483648 +False +False +-2147483648 +-2147483648 +-2147483648 +2147483648 +2147483648 +-2147483648 +-2147483648 diff --git a/testsuite/tests/numeric/should_run/numrun009.stdout-alpha-dec-osf3 b/testsuite/tests/numeric/should_run/numrun009.stdout-alpha-dec-osf3 new file mode 100644 index 0000000000..8d37dbc11e --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun009.stdout-alpha-dec-osf3 @@ -0,0 +1,12 @@ +-2147483648 +-2147483648 +-2147483648 +False +False +2147483648 +2147483648 +2147483648 +2147483648 +2147483648 +-2147483648 +-2147483648 diff --git a/testsuite/tests/numeric/should_run/numrun009.stdout-mips-sgi-irix b/testsuite/tests/numeric/should_run/numrun009.stdout-mips-sgi-irix new file mode 100644 index 0000000000..8d37dbc11e --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun009.stdout-mips-sgi-irix @@ -0,0 +1,12 @@ +-2147483648 +-2147483648 +-2147483648 +False +False +2147483648 +2147483648 +2147483648 +2147483648 +2147483648 +-2147483648 +-2147483648 diff --git a/testsuite/tests/numeric/should_run/numrun009.stdout-ws-64 b/testsuite/tests/numeric/should_run/numrun009.stdout-ws-64 new file mode 100644 index 0000000000..8d37dbc11e --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun009.stdout-ws-64 @@ -0,0 +1,12 @@ +-2147483648 +-2147483648 +-2147483648 +False +False +2147483648 +2147483648 +2147483648 +2147483648 +2147483648 +-2147483648 +-2147483648 diff --git a/testsuite/tests/numeric/should_run/numrun009.stdout-x86_64-unknown-openbsd b/testsuite/tests/numeric/should_run/numrun009.stdout-x86_64-unknown-openbsd new file mode 100644 index 0000000000..8d37dbc11e --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun009.stdout-x86_64-unknown-openbsd @@ -0,0 +1,12 @@ +-2147483648 +-2147483648 +-2147483648 +False +False +2147483648 +2147483648 +2147483648 +2147483648 +2147483648 +-2147483648 +-2147483648 diff --git a/testsuite/tests/numeric/should_run/numrun010.hs b/testsuite/tests/numeric/should_run/numrun010.hs new file mode 100644 index 0000000000..027b5e8d76 --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun010.hs @@ -0,0 +1,13 @@ +-- !!! tests that local fixity declarations work + +-- If local fixity decls don't work you get "14" +-- The right answer is "11" + +val = 3 +! 4 *! 2 + where (+!) = (+) + (*!) = (*) + infixl 6 +! + infixl 7 *! + +main = print val + diff --git a/testsuite/tests/numeric/should_run/numrun010.stdout b/testsuite/tests/numeric/should_run/numrun010.stdout new file mode 100644 index 0000000000..b4de394767 --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun010.stdout @@ -0,0 +1 @@ +11 diff --git a/testsuite/tests/numeric/should_run/numrun011.hs b/testsuite/tests/numeric/should_run/numrun011.hs new file mode 100644 index 0000000000..d259613d2f --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun011.hs @@ -0,0 +1,2 @@ +import Data.Ratio +main = print (fromRational (1 % 85070591730234615865843651857942052864) :: Float) diff --git a/testsuite/tests/numeric/should_run/numrun011.stdout b/testsuite/tests/numeric/should_run/numrun011.stdout new file mode 100644 index 0000000000..202e6ca9d7 --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun011.stdout @@ -0,0 +1 @@ +1.1754944e-38 diff --git a/testsuite/tests/numeric/should_run/numrun012.hs b/testsuite/tests/numeric/should_run/numrun012.hs new file mode 100644 index 0000000000..df8c69040c --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun012.hs @@ -0,0 +1,35 @@ + +-- Test for trac #921 + +import GHC.Float +import Foreign +import Control.Monad + +main :: IO () +main = do -- The reported case + putStrLn (show (map log2 vals)) + -- Smaller failing cases + print (fromIntegral ((2^31) :: Int) :: Double) + if_not_32 $ print (round ((2^33) :: Double) :: Int) + print (fromIntegral ((2^31) :: Int) :: Float) + if_not_32 $ print (round ((2^33) :: Float) :: Int) + -- The underlying failing internal operations + print (int2Double (2^31)) + if_not_32 $ print (double2Int (2^33)) + print (int2Float (2^31)) + if_not_32 $ print (float2Int (2^33)) + where + -- the value of float2Int x where the result would be outside the + -- range of the target is undefined. We also take the view in GHC + -- that round and truncate are similarly undefined when the result + -- would be outside the range of the target type (see #1254) + if_not_32 = when (sizeOf (undefined::Int) > 4) + +log2 x = ceiling log_x + where log_x :: Double + log_x = logBase 2 (fromIntegral (max 1 x)) + +vals = [1, 2, 17, 259, 1000, 10000, + 2^30 + 9000, 2^31 - 1, 2^31, 2^31 + 1, + 2^32 - 1, 2^32, 2^32 + 1] + diff --git a/testsuite/tests/numeric/should_run/numrun012.stdout b/testsuite/tests/numeric/should_run/numrun012.stdout new file mode 100644 index 0000000000..f94829ccfd --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun012.stdout @@ -0,0 +1,5 @@ +[0,1,5,9,10,14,31,31,32,32,32,32,33] +-2.147483648e9 +-2.1474836e9 +-2.147483648e9 +-2.1474836e9 diff --git a/testsuite/tests/numeric/should_run/numrun012.stdout-ws-64 b/testsuite/tests/numeric/should_run/numrun012.stdout-ws-64 new file mode 100644 index 0000000000..ffd0389201 --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun012.stdout-ws-64 @@ -0,0 +1,9 @@ +[0,1,5,9,10,14,31,31,32,32,32,32,33] +2.147483648e9 +8589934592 +2.1474836e9 +8589934592 +2.147483648e9 +8589934592 +2.1474836e9 +8589934592 diff --git a/testsuite/tests/numeric/should_run/numrun013.hs b/testsuite/tests/numeric/should_run/numrun013.hs new file mode 100644 index 0000000000..93fe56f74c --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun013.hs @@ -0,0 +1,17 @@ + +-- Test for trac #1042 + +import Control.Exception +import Data.Int +import Prelude hiding (catch) + +main :: IO () +main = do print ((minBound :: Int) `div` (-1)) `myCatch` print + print ((minBound :: Int8) `div` (-1)) `myCatch` print + print ((minBound :: Int16) `div` (-1)) `myCatch` print + print ((minBound :: Int32) `div` (-1)) `myCatch` print + print ((minBound :: Int64) `div` (-1)) `myCatch` print + +myCatch :: IO a -> (ArithException -> IO a) -> IO a +myCatch = catch + diff --git a/testsuite/tests/numeric/should_run/numrun013.stdout b/testsuite/tests/numeric/should_run/numrun013.stdout new file mode 100644 index 0000000000..605f8e7cc0 --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun013.stdout @@ -0,0 +1,5 @@ +arithmetic overflow +arithmetic overflow +arithmetic overflow +arithmetic overflow +arithmetic overflow diff --git a/testsuite/tests/numeric/should_run/numrun014.hs b/testsuite/tests/numeric/should_run/numrun014.hs new file mode 100644 index 0000000000..207e7663c0 --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun014.hs @@ -0,0 +1,211 @@ + +-- Test that we don't have rules (or othre optimisations) doing the +-- wrong thing for constant folding with Doubles. + +module Main (main) where + +zero :: Double +zero = 0 + +one :: Double +one = 1 + +nan :: Double +nan = 0 / 0 + +inf :: Double +inf = 1 / 0 + +neginf :: Double +neginf = -1 / 0 + +fzero :: Float +fzero = 0 + +fone :: Float +fone = 1 + +fnan :: Float +fnan = 0 / 0 + +finf :: Float +finf = 1 / 0 + +fneginf :: Float +fneginf = -1 / 0 + +main :: IO () +main = do putStrLn "=== Subtraction ===" + print (zero - zero) + print (zero - nan) + print (zero - inf) + print (zero - neginf) + print (nan - zero) + print (nan - nan) + print (nan - inf) + print (nan - neginf) + print (inf - zero) + print (inf - nan) + print (inf - inf) + print (inf - neginf) + print (neginf - zero) + print (neginf - nan) + print (neginf - inf) + print (neginf - neginf) + putStrLn "=== Addition ===" + print (zero + zero) + print (zero + nan) + print (zero + inf) + print (zero + neginf) + print (nan + zero) + print (nan + nan) + print (nan + inf) + print (nan + neginf) + print (inf + zero) + print (inf + nan) + print (inf + inf) + print (inf + neginf) + print (neginf + zero) + print (neginf + nan) + print (neginf + inf) + print (neginf + neginf) + putStrLn "=== Mutiplication ===" + print (zero * zero) + print (zero * one) + print (zero * nan) + print (zero * inf) + print (zero * neginf) + print (one * zero) + print (one * one) + print (one * nan) + print (one * inf) + print (one * neginf) + print (nan * zero) + print (nan * one) + print (nan * nan) + print (nan * inf) + print (nan * neginf) + print (inf * zero) + print (inf * one) + print (inf * nan) + print (inf * inf) + print (inf * neginf) + print (neginf * zero) + print (neginf * one) + print (neginf * nan) + print (neginf * inf) + print (neginf * neginf) + putStrLn "=== Division ===" + print (zero / zero) + print (zero / one) + print (zero / nan) + print (zero / inf) + print (zero / neginf) + print (one / zero) + print (one / one) + print (one / nan) + print (one / inf) + print (one / neginf) + print (nan / zero) + print (nan / one) + print (nan / nan) + print (nan / inf) + print (nan / neginf) + print (inf / zero) + print (inf / one) + print (inf / nan) + print (inf / inf) + print (inf / neginf) + print (neginf / zero) + print (neginf / one) + print (neginf / nan) + print (neginf / inf) + print (neginf / neginf) + + putStrLn "=== Subtraction ===" + print (fzero - fzero) + print (fzero - fnan) + print (fzero - finf) + print (fzero - fneginf) + print (fnan - fzero) + print (fnan - fnan) + print (fnan - finf) + print (fnan - fneginf) + print (finf - fzero) + print (finf - fnan) + print (finf - finf) + print (finf - fneginf) + print (fneginf - fzero) + print (fneginf - fnan) + print (fneginf - finf) + print (fneginf - fneginf) + putStrLn "=== Addition ===" + print (fzero + fzero) + print (fzero + fnan) + print (fzero + finf) + print (fzero + fneginf) + print (fnan + fzero) + print (fnan + fnan) + print (fnan + finf) + print (fnan + fneginf) + print (finf + fzero) + print (finf + fnan) + print (finf + finf) + print (finf + fneginf) + print (fneginf + fzero) + print (fneginf + fnan) + print (fneginf + finf) + print (fneginf + fneginf) + putStrLn "=== Mutiplication ===" + print (fzero * fzero) + print (fzero * fone) + print (fzero * fnan) + print (fzero * finf) + print (fzero * fneginf) + print (fone * fzero) + print (fone * fone) + print (fone * fnan) + print (fone * finf) + print (fone * fneginf) + print (fnan * fzero) + print (fnan * fone) + print (fnan * fnan) + print (fnan * finf) + print (fnan * fneginf) + print (finf * fzero) + print (finf * fone) + print (finf * fnan) + print (finf * finf) + print (finf * fneginf) + print (fneginf * fzero) + print (fneginf * fone) + print (fneginf * fnan) + print (fneginf * finf) + print (fneginf * fneginf) + putStrLn "=== Division ===" + print (fzero / fzero) + print (fzero / fone) + print (fzero / fnan) + print (fzero / finf) + print (fzero / fneginf) + print (fone / fzero) + print (fone / fone) + print (fone / fnan) + print (fone / finf) + print (fone / fneginf) + print (fnan / fzero) + print (fnan / fone) + print (fnan / fnan) + print (fnan / finf) + print (fnan / fneginf) + print (finf / fzero) + print (finf / fone) + print (finf / fnan) + print (finf / finf) + print (finf / fneginf) + print (fneginf / fzero) + print (fneginf / fone) + print (fneginf / fnan) + print (fneginf / finf) + print (fneginf / fneginf) + diff --git a/testsuite/tests/numeric/should_run/numrun014.stdout b/testsuite/tests/numeric/should_run/numrun014.stdout new file mode 100644 index 0000000000..3bcfad620d --- /dev/null +++ b/testsuite/tests/numeric/should_run/numrun014.stdout @@ -0,0 +1,172 @@ +=== Subtraction === +0.0 +NaN +-Infinity +Infinity +NaN +NaN +NaN +NaN +Infinity +NaN +NaN +Infinity +-Infinity +NaN +-Infinity +NaN +=== Addition === +0.0 +NaN +Infinity +-Infinity +NaN +NaN +NaN +NaN +Infinity +NaN +Infinity +NaN +-Infinity +NaN +NaN +-Infinity +=== Mutiplication === +0.0 +0.0 +NaN +NaN +NaN +0.0 +1.0 +NaN +Infinity +-Infinity +NaN +NaN +NaN +NaN +NaN +NaN +Infinity +NaN +Infinity +-Infinity +NaN +-Infinity +NaN +-Infinity +Infinity +=== Division === +NaN +0.0 +NaN +0.0 +-0.0 +Infinity +1.0 +NaN +0.0 +-0.0 +NaN +NaN +NaN +NaN +NaN +Infinity +Infinity +NaN +NaN +NaN +-Infinity +-Infinity +NaN +NaN +NaN +=== Subtraction === +0.0 +NaN +-Infinity +Infinity +NaN +NaN +NaN +NaN +Infinity +NaN +NaN +Infinity +-Infinity +NaN +-Infinity +NaN +=== Addition === +0.0 +NaN +Infinity +-Infinity +NaN +NaN +NaN +NaN +Infinity +NaN +Infinity +NaN +-Infinity +NaN +NaN +-Infinity +=== Mutiplication === +0.0 +0.0 +NaN +NaN +NaN +0.0 +1.0 +NaN +Infinity +-Infinity +NaN +NaN +NaN +NaN +NaN +NaN +Infinity +NaN +Infinity +-Infinity +NaN +-Infinity +NaN +-Infinity +Infinity +=== Division === +NaN +0.0 +NaN +0.0 +-0.0 +Infinity +1.0 +NaN +0.0 +-0.0 +NaN +NaN +NaN +NaN +NaN +Infinity +Infinity +NaN +NaN +NaN +-Infinity +-Infinity +NaN +NaN +NaN |