mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
library/uint32.m:
As above.
tests/hard_coded/Mmakefile:
tests/hard_coded/rotate_uint32.{m,exp}:
Add a test for the new operations.
89 lines
5.1 KiB
Plaintext
89 lines
5.1 KiB
Plaintext
*** Test 'rotate_left' ***
|
|
|
|
rotate_left(00000000000000000000000000000001, 0) = 00000000000000000000000000000001
|
|
unchecked_rotate_left(00000000000000000000000000000001, 0) = 00000000000000000000000000000001
|
|
|
|
rotate_left(00000000000000000000000000000001, 1) = 00000000000000000000000000000010
|
|
unchecked_rotate_left(00000000000000000000000000000001, 1) = 00000000000000000000000000000010
|
|
|
|
rotate_left(00000000000000000000000000000001, 2) = 00000000000000000000000000000100
|
|
unchecked_rotate_left(00000000000000000000000000000001, 2) = 00000000000000000000000000000100
|
|
|
|
rotate_left(00000000000000000000000000000001, 31) = 10000000000000000000000000000000
|
|
unchecked_rotate_left(00000000000000000000000000000001, 31) = 10000000000000000000000000000000
|
|
|
|
rotate_left(00000000000000000000000000000001, 32) = <<exception>>
|
|
unchecked_rotate_left(00000000000000000000000000000001, 32) = 00000000000000000000000000000001
|
|
|
|
rotate_left(00000000000000000000000000000001, 63) = <<exception>>
|
|
unchecked_rotate_left(00000000000000000000000000000001, 63) = 10000000000000000000000000000000
|
|
|
|
rotate_left(00000000000000000000000000000001, 64) = <<exception>>
|
|
unchecked_rotate_left(00000000000000000000000000000001, 64) = 00000000000000000000000000000001
|
|
|
|
rotate_left(00000000000000000000000011111111, 0) = 00000000000000000000000011111111
|
|
unchecked_rotate_left(00000000000000000000000011111111, 0) = 00000000000000000000000011111111
|
|
|
|
rotate_left(00000000000000000000000011111111, 1) = 00000000000000000000000111111110
|
|
unchecked_rotate_left(00000000000000000000000011111111, 1) = 00000000000000000000000111111110
|
|
|
|
rotate_left(00000000000000000000000011111111, 2) = 00000000000000000000001111111100
|
|
unchecked_rotate_left(00000000000000000000000011111111, 2) = 00000000000000000000001111111100
|
|
|
|
rotate_left(00000000000000000000000011111111, 31) = 10000000000000000000000001111111
|
|
unchecked_rotate_left(00000000000000000000000011111111, 31) = 10000000000000000000000001111111
|
|
|
|
rotate_left(00000000000000000000000011111111, 32) = <<exception>>
|
|
unchecked_rotate_left(00000000000000000000000011111111, 32) = 00000000000000000000000011111111
|
|
|
|
rotate_left(00000000000000000000000011111111, 63) = <<exception>>
|
|
unchecked_rotate_left(00000000000000000000000011111111, 63) = 10000000000000000000000001111111
|
|
|
|
rotate_left(00000000000000000000000011111111, 64) = <<exception>>
|
|
unchecked_rotate_left(00000000000000000000000011111111, 64) = 00000000000000000000000011111111
|
|
|
|
*** Test 'rotate_right' ***
|
|
|
|
rotate_right(00000000000000000000000000000001, 0) = 00000000000000000000000000000001
|
|
unchecked_rotate_right(00000000000000000000000000000001, 0) = 00000000000000000000000000000001
|
|
|
|
rotate_right(00000000000000000000000000000001, 1) = 10000000000000000000000000000000
|
|
unchecked_rotate_right(00000000000000000000000000000001, 1) = 10000000000000000000000000000000
|
|
|
|
rotate_right(00000000000000000000000000000001, 2) = 01000000000000000000000000000000
|
|
unchecked_rotate_right(00000000000000000000000000000001, 2) = 01000000000000000000000000000000
|
|
|
|
rotate_right(00000000000000000000000000000001, 31) = 00000000000000000000000000000010
|
|
unchecked_rotate_right(00000000000000000000000000000001, 31) = 00000000000000000000000000000010
|
|
|
|
rotate_right(00000000000000000000000000000001, 32) = <<exception>>
|
|
unchecked_rotate_right(00000000000000000000000000000001, 32) = 00000000000000000000000000000001
|
|
|
|
rotate_right(00000000000000000000000000000001, 63) = <<exception>>
|
|
unchecked_rotate_right(00000000000000000000000000000001, 63) = 00000000000000000000000000000010
|
|
|
|
rotate_right(00000000000000000000000000000001, 64) = <<exception>>
|
|
unchecked_rotate_right(00000000000000000000000000000001, 64) = 00000000000000000000000000000001
|
|
|
|
rotate_right(00000000000000000000000011111111, 0) = 00000000000000000000000011111111
|
|
unchecked_rotate_right(00000000000000000000000011111111, 0) = 00000000000000000000000011111111
|
|
|
|
rotate_right(00000000000000000000000011111111, 1) = 10000000000000000000000001111111
|
|
unchecked_rotate_right(00000000000000000000000011111111, 1) = 10000000000000000000000001111111
|
|
|
|
rotate_right(00000000000000000000000011111111, 2) = 11000000000000000000000000111111
|
|
unchecked_rotate_right(00000000000000000000000011111111, 2) = 11000000000000000000000000111111
|
|
|
|
rotate_right(00000000000000000000000011111111, 31) = 00000000000000000000000111111110
|
|
unchecked_rotate_right(00000000000000000000000011111111, 31) = 00000000000000000000000111111110
|
|
|
|
rotate_right(00000000000000000000000011111111, 32) = <<exception>>
|
|
unchecked_rotate_right(00000000000000000000000011111111, 32) = 00000000000000000000000011111111
|
|
|
|
rotate_right(00000000000000000000000011111111, 63) = <<exception>>
|
|
unchecked_rotate_right(00000000000000000000000011111111, 63) = 00000000000000000000000111111110
|
|
|
|
rotate_right(00000000000000000000000011111111, 64) = <<exception>>
|
|
unchecked_rotate_right(00000000000000000000000011111111, 64) = 00000000000000000000000011111111
|
|
|