mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
library/uint64.m:
As above.
tests/hard_coded/Mmakefile:
tests/hard_coded/rotate_uint64.{m,exp}:
Add a test for the new operations.
89 lines
8.2 KiB
Plaintext
89 lines
8.2 KiB
Plaintext
*** Test 'rotate_left' ***
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 0) = 0000000000000000000000000000000000000000000000000000000000000001
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 0) = 0000000000000000000000000000000000000000000000000000000000000001
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 1) = 0000000000000000000000000000000000000000000000000000000000000010
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 1) = 0000000000000000000000000000000000000000000000000000000000000010
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 2) = 0000000000000000000000000000000000000000000000000000000000000100
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 2) = 0000000000000000000000000000000000000000000000000000000000000100
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 63) = 1000000000000000000000000000000000000000000000000000000000000000
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 63) = 1000000000000000000000000000000000000000000000000000000000000000
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 64) = <<exception>>
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 64) = 0000000000000000000000000000000000000000000000000000000000000001
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 127) = <<exception>>
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 127) = 1000000000000000000000000000000000000000000000000000000000000000
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 128) = <<exception>>
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 128) = 0000000000000000000000000000000000000000000000000000000000000001
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 0) = 0000000000000000000000000000000000000000000000000000000011111111
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 0) = 0000000000000000000000000000000000000000000000000000000011111111
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 1) = 0000000000000000000000000000000000000000000000000000000111111110
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 1) = 0000000000000000000000000000000000000000000000000000000111111110
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 2) = 0000000000000000000000000000000000000000000000000000001111111100
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 2) = 0000000000000000000000000000000000000000000000000000001111111100
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 63) = 1000000000000000000000000000000000000000000000000000000001111111
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 63) = 1000000000000000000000000000000000000000000000000000000001111111
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 64) = <<exception>>
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 64) = 0000000000000000000000000000000000000000000000000000000011111111
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 127) = <<exception>>
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 127) = 1000000000000000000000000000000000000000000000000000000001111111
|
|
|
|
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 128) = <<exception>>
|
|
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 128) = 0000000000000000000000000000000000000000000000000000000011111111
|
|
|
|
*** Test 'rotate_right' ***
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 0) = 0000000000000000000000000000000000000000000000000000000000000001
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 0) = 0000000000000000000000000000000000000000000000000000000000000001
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 1) = 1000000000000000000000000000000000000000000000000000000000000000
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 1) = 1000000000000000000000000000000000000000000000000000000000000000
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 2) = 0100000000000000000000000000000000000000000000000000000000000000
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 2) = 0100000000000000000000000000000000000000000000000000000000000000
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 63) = 0000000000000000000000000000000000000000000000000000000000000010
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 63) = 0000000000000000000000000000000000000000000000000000000000000010
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 64) = <<exception>>
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 64) = 0000000000000000000000000000000000000000000000000000000000000001
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 127) = <<exception>>
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 127) = 0000000000000000000000000000000000000000000000000000000000000010
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 128) = <<exception>>
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 128) = 0000000000000000000000000000000000000000000000000000000000000001
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 0) = 0000000000000000000000000000000000000000000000000000000011111111
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 0) = 0000000000000000000000000000000000000000000000000000000011111111
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 1) = 1000000000000000000000000000000000000000000000000000000001111111
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 1) = 1000000000000000000000000000000000000000000000000000000001111111
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 2) = 1100000000000000000000000000000000000000000000000000000000111111
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 2) = 1100000000000000000000000000000000000000000000000000000000111111
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 63) = 0000000000000000000000000000000000000000000000000000000111111110
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 63) = 0000000000000000000000000000000000000000000000000000000111111110
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 64) = <<exception>>
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 64) = 0000000000000000000000000000000000000000000000000000000011111111
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 127) = <<exception>>
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 127) = 0000000000000000000000000000000000000000000000000000000111111110
|
|
|
|
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 128) = <<exception>>
|
|
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 128) = 0000000000000000000000000000000000000000000000000000000011111111
|
|
|