mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 18:03:36 +00:00
386 lines
11 KiB
Plaintext
386 lines
11 KiB
Plaintext
plus(1, 0) = 1
|
|
plus(1, 1) = 2
|
|
plus(1, -1) = 0
|
|
plus(1, 31) = 32
|
|
plus(1, -31) = -30
|
|
plus(1, 2147483647) = -2147483648
|
|
plus(1, -2147483648) = -2147483647
|
|
plus(-1, 0) = -1
|
|
plus(-1, 1) = 0
|
|
plus(-1, -1) = -2
|
|
plus(-1, 31) = 30
|
|
plus(-1, -31) = -32
|
|
plus(-1, 2147483647) = 2147483646
|
|
plus(-1, -2147483648) = 2147483647
|
|
plus(31, 0) = 31
|
|
plus(31, 1) = 32
|
|
plus(31, -1) = 30
|
|
plus(31, 31) = 62
|
|
plus(31, -31) = 0
|
|
plus(31, 2147483647) = -2147483618
|
|
plus(31, -2147483648) = -2147483617
|
|
plus(-31, 0) = -31
|
|
plus(-31, 1) = -30
|
|
plus(-31, -1) = -32
|
|
plus(-31, 31) = 0
|
|
plus(-31, -31) = -62
|
|
plus(-31, 2147483647) = 2147483616
|
|
plus(-31, -2147483648) = 2147483617
|
|
plus(2147483647, 0) = 2147483647
|
|
plus(2147483647, 1) = -2147483648
|
|
plus(2147483647, -1) = 2147483646
|
|
plus(2147483647, 31) = -2147483618
|
|
plus(2147483647, -31) = 2147483616
|
|
plus(2147483647, 2147483647) = -2
|
|
plus(2147483647, -2147483648) = -1
|
|
plus(-2147483648, 0) = -2147483648
|
|
plus(-2147483648, 1) = -2147483647
|
|
plus(-2147483648, -1) = 2147483647
|
|
plus(-2147483648, 31) = -2147483617
|
|
plus(-2147483648, -31) = 2147483617
|
|
plus(-2147483648, 2147483647) = -1
|
|
plus(-2147483648, -2147483648) = 0
|
|
|
|
minus(1, 0) = 1
|
|
minus(1, 1) = 0
|
|
minus(1, -1) = 2
|
|
minus(1, 31) = -30
|
|
minus(1, -31) = 32
|
|
minus(1, 2147483647) = -2147483646
|
|
minus(1, -2147483648) = -2147483647
|
|
minus(-1, 0) = -1
|
|
minus(-1, 1) = -2
|
|
minus(-1, -1) = 0
|
|
minus(-1, 31) = -32
|
|
minus(-1, -31) = 30
|
|
minus(-1, 2147483647) = -2147483648
|
|
minus(-1, -2147483648) = 2147483647
|
|
minus(31, 0) = 31
|
|
minus(31, 1) = 30
|
|
minus(31, -1) = 32
|
|
minus(31, 31) = 0
|
|
minus(31, -31) = 62
|
|
minus(31, 2147483647) = -2147483616
|
|
minus(31, -2147483648) = -2147483617
|
|
minus(-31, 0) = -31
|
|
minus(-31, 1) = -32
|
|
minus(-31, -1) = -30
|
|
minus(-31, 31) = -62
|
|
minus(-31, -31) = 0
|
|
minus(-31, 2147483647) = 2147483618
|
|
minus(-31, -2147483648) = 2147483617
|
|
minus(2147483647, 0) = 2147483647
|
|
minus(2147483647, 1) = 2147483646
|
|
minus(2147483647, -1) = -2147483648
|
|
minus(2147483647, 31) = 2147483616
|
|
minus(2147483647, -31) = -2147483618
|
|
minus(2147483647, 2147483647) = 0
|
|
minus(2147483647, -2147483648) = -1
|
|
minus(-2147483648, 0) = -2147483648
|
|
minus(-2147483648, 1) = 2147483647
|
|
minus(-2147483648, -1) = -2147483647
|
|
minus(-2147483648, 31) = 2147483617
|
|
minus(-2147483648, -31) = -2147483617
|
|
minus(-2147483648, 2147483647) = 1
|
|
minus(-2147483648, -2147483648) = 0
|
|
|
|
times(1, 0) = 0
|
|
times(1, 1) = 1
|
|
times(1, -1) = -1
|
|
times(1, 31) = 31
|
|
times(1, -31) = -31
|
|
times(1, 2147483647) = 2147483647
|
|
times(1, -2147483648) = -2147483648
|
|
times(-1, 0) = 0
|
|
times(-1, 1) = -1
|
|
times(-1, -1) = 1
|
|
times(-1, 31) = -31
|
|
times(-1, -31) = 31
|
|
times(-1, 2147483647) = -2147483647
|
|
times(-1, -2147483648) = -2147483648
|
|
times(31, 0) = 0
|
|
times(31, 1) = 31
|
|
times(31, -1) = -31
|
|
times(31, 31) = 961
|
|
times(31, -31) = -961
|
|
times(31, 2147483647) = 2147483617
|
|
times(31, -2147483648) = -2147483648
|
|
times(-31, 0) = 0
|
|
times(-31, 1) = -31
|
|
times(-31, -1) = 31
|
|
times(-31, 31) = -961
|
|
times(-31, -31) = 961
|
|
times(-31, 2147483647) = -2147483617
|
|
times(-31, -2147483648) = -2147483648
|
|
times(2147483647, 0) = 0
|
|
times(2147483647, 1) = 2147483647
|
|
times(2147483647, -1) = -2147483647
|
|
times(2147483647, 31) = 2147483617
|
|
times(2147483647, -31) = -2147483617
|
|
times(2147483647, 2147483647) = 1
|
|
times(2147483647, -2147483648) = -2147483648
|
|
times(-2147483648, 0) = 0
|
|
times(-2147483648, 1) = -2147483648
|
|
times(-2147483648, -1) = -2147483648
|
|
times(-2147483648, 31) = -2147483648
|
|
times(-2147483648, -31) = -2147483648
|
|
times(-2147483648, 2147483647) = -2147483648
|
|
times(-2147483648, -2147483648) = 0
|
|
|
|
quotient(1, 1) = 1
|
|
quotient(1, -1) = -1
|
|
quotient(1, 31) = 0
|
|
quotient(1, -31) = 0
|
|
quotient(1, 2147483647) = 0
|
|
quotient(1, -2147483648) = 0
|
|
quotient(-1, 1) = -1
|
|
quotient(-1, -1) = 1
|
|
quotient(-1, 31) = 0
|
|
quotient(-1, -31) = 0
|
|
quotient(-1, 2147483647) = 0
|
|
quotient(-1, -2147483648) = 0
|
|
quotient(31, 1) = 31
|
|
quotient(31, -1) = -31
|
|
quotient(31, 31) = 1
|
|
quotient(31, -31) = -1
|
|
quotient(31, 2147483647) = 0
|
|
quotient(31, -2147483648) = 0
|
|
quotient(-31, 1) = -31
|
|
quotient(-31, -1) = 31
|
|
quotient(-31, 31) = -1
|
|
quotient(-31, -31) = 1
|
|
quotient(-31, 2147483647) = 0
|
|
quotient(-31, -2147483648) = 0
|
|
quotient(2147483647, 1) = 2147483647
|
|
quotient(2147483647, -1) = -2147483647
|
|
quotient(2147483647, 31) = 69273666
|
|
quotient(2147483647, -31) = -69273666
|
|
quotient(2147483647, 2147483647) = 1
|
|
quotient(2147483647, -2147483648) = 0
|
|
quotient(-2147483648, 1) = -2147483648
|
|
quotient(-2147483648, 31) = -69273666
|
|
quotient(-2147483648, -31) = 69273666
|
|
quotient(-2147483648, 2147483647) = -1
|
|
quotient(-2147483648, -2147483648) = 1
|
|
|
|
unchecked_quotient(1, 1) = 1
|
|
unchecked_quotient(1, -1) = -1
|
|
unchecked_quotient(1, 31) = 0
|
|
unchecked_quotient(1, -31) = 0
|
|
unchecked_quotient(1, 2147483647) = 0
|
|
unchecked_quotient(1, -2147483648) = 0
|
|
unchecked_quotient(-1, 1) = -1
|
|
unchecked_quotient(-1, -1) = 1
|
|
unchecked_quotient(-1, 31) = 0
|
|
unchecked_quotient(-1, -31) = 0
|
|
unchecked_quotient(-1, 2147483647) = 0
|
|
unchecked_quotient(-1, -2147483648) = 0
|
|
unchecked_quotient(31, 1) = 31
|
|
unchecked_quotient(31, -1) = -31
|
|
unchecked_quotient(31, 31) = 1
|
|
unchecked_quotient(31, -31) = -1
|
|
unchecked_quotient(31, 2147483647) = 0
|
|
unchecked_quotient(31, -2147483648) = 0
|
|
unchecked_quotient(-31, 1) = -31
|
|
unchecked_quotient(-31, -1) = 31
|
|
unchecked_quotient(-31, 31) = -1
|
|
unchecked_quotient(-31, -31) = 1
|
|
unchecked_quotient(-31, 2147483647) = 0
|
|
unchecked_quotient(-31, -2147483648) = 0
|
|
unchecked_quotient(2147483647, 1) = 2147483647
|
|
unchecked_quotient(2147483647, -1) = -2147483647
|
|
unchecked_quotient(2147483647, 31) = 69273666
|
|
unchecked_quotient(2147483647, -31) = -69273666
|
|
unchecked_quotient(2147483647, 2147483647) = 1
|
|
unchecked_quotient(2147483647, -2147483648) = 0
|
|
unchecked_quotient(-2147483648, 1) = -2147483648
|
|
unchecked_quotient(-2147483648, 31) = -69273666
|
|
unchecked_quotient(-2147483648, -31) = 69273666
|
|
unchecked_quotient(-2147483648, 2147483647) = -1
|
|
unchecked_quotient(-2147483648, -2147483648) = 1
|
|
|
|
mod(1, 1) = 0
|
|
mod(1, -1) = 0
|
|
mod(1, 31) = 1
|
|
mod(1, -31) = -30
|
|
mod(1, 2147483647) = 1
|
|
mod(1, -2147483648) = -2147483647
|
|
mod(-1, 1) = 0
|
|
mod(-1, -1) = 0
|
|
mod(-1, 31) = 30
|
|
mod(-1, -31) = -1
|
|
mod(-1, 2147483647) = 2147483646
|
|
mod(-1, -2147483648) = -1
|
|
mod(31, 1) = 0
|
|
mod(31, -1) = 0
|
|
mod(31, 31) = 0
|
|
mod(31, -31) = 0
|
|
mod(31, 2147483647) = 31
|
|
mod(31, -2147483648) = -2147483617
|
|
mod(-31, 1) = 0
|
|
mod(-31, -1) = 0
|
|
mod(-31, 31) = 0
|
|
mod(-31, -31) = 0
|
|
mod(-31, 2147483647) = 2147483616
|
|
mod(-31, -2147483648) = -31
|
|
mod(2147483647, 1) = 0
|
|
mod(2147483647, -1) = 0
|
|
mod(2147483647, 31) = 1
|
|
mod(2147483647, -31) = -30
|
|
mod(2147483647, 2147483647) = 0
|
|
mod(2147483647, -2147483648) = -1
|
|
mod(-2147483648, 1) = 0
|
|
mod(-2147483648, 31) = 29
|
|
mod(-2147483648, -31) = -2
|
|
mod(-2147483648, 2147483647) = 2147483646
|
|
mod(-2147483648, -2147483648) = 0
|
|
|
|
rem(1, 1) = 0
|
|
rem(1, -1) = 0
|
|
rem(1, 31) = 1
|
|
rem(1, -31) = 1
|
|
rem(1, 2147483647) = 1
|
|
rem(1, -2147483648) = 1
|
|
rem(-1, 1) = 0
|
|
rem(-1, -1) = 0
|
|
rem(-1, 31) = -1
|
|
rem(-1, -31) = -1
|
|
rem(-1, 2147483647) = -1
|
|
rem(-1, -2147483648) = -1
|
|
rem(31, 1) = 0
|
|
rem(31, -1) = 0
|
|
rem(31, 31) = 0
|
|
rem(31, -31) = 0
|
|
rem(31, 2147483647) = 31
|
|
rem(31, -2147483648) = 31
|
|
rem(-31, 1) = 0
|
|
rem(-31, -1) = 0
|
|
rem(-31, 31) = 0
|
|
rem(-31, -31) = 0
|
|
rem(-31, 2147483647) = -31
|
|
rem(-31, -2147483648) = -31
|
|
rem(2147483647, 1) = 0
|
|
rem(2147483647, -1) = 0
|
|
rem(2147483647, 31) = 1
|
|
rem(2147483647, -31) = 1
|
|
rem(2147483647, 2147483647) = 0
|
|
rem(2147483647, -2147483648) = 2147483647
|
|
rem(-2147483648, 1) = 0
|
|
rem(-2147483648, 31) = -2
|
|
rem(-2147483648, -31) = -2
|
|
rem(-2147483648, 2147483647) = -1
|
|
rem(-2147483648, -2147483648) = 0
|
|
|
|
unchecked_rem(1, 1) = 0
|
|
unchecked_rem(1, -1) = 0
|
|
unchecked_rem(1, 31) = 1
|
|
unchecked_rem(1, -31) = 1
|
|
unchecked_rem(1, 2147483647) = 1
|
|
unchecked_rem(1, -2147483648) = 1
|
|
unchecked_rem(-1, 1) = 0
|
|
unchecked_rem(-1, -1) = 0
|
|
unchecked_rem(-1, 31) = -1
|
|
unchecked_rem(-1, -31) = -1
|
|
unchecked_rem(-1, 2147483647) = -1
|
|
unchecked_rem(-1, -2147483648) = -1
|
|
unchecked_rem(31, 1) = 0
|
|
unchecked_rem(31, -1) = 0
|
|
unchecked_rem(31, 31) = 0
|
|
unchecked_rem(31, -31) = 0
|
|
unchecked_rem(31, 2147483647) = 31
|
|
unchecked_rem(31, -2147483648) = 31
|
|
unchecked_rem(-31, 1) = 0
|
|
unchecked_rem(-31, -1) = 0
|
|
unchecked_rem(-31, 31) = 0
|
|
unchecked_rem(-31, -31) = 0
|
|
unchecked_rem(-31, 2147483647) = -31
|
|
unchecked_rem(-31, -2147483648) = -31
|
|
unchecked_rem(2147483647, 1) = 0
|
|
unchecked_rem(2147483647, -1) = 0
|
|
unchecked_rem(2147483647, 31) = 1
|
|
unchecked_rem(2147483647, -31) = 1
|
|
unchecked_rem(2147483647, 2147483647) = 0
|
|
unchecked_rem(2147483647, -2147483648) = 2147483647
|
|
unchecked_rem(-2147483648, 1) = 0
|
|
unchecked_rem(-2147483648, 31) = -2
|
|
unchecked_rem(-2147483648, -31) = -2
|
|
unchecked_rem(-2147483648, 2147483647) = -1
|
|
unchecked_rem(-2147483648, -2147483648) = 0
|
|
|
|
left_shift(1, 0) = 1
|
|
left_shift(1, 1) = 2
|
|
left_shift(1, 31) = -2147483648
|
|
left_shift(-1, 0) = -1
|
|
left_shift(-1, 1) = -2
|
|
left_shift(-1, 31) = -2147483648
|
|
left_shift(31, 0) = 31
|
|
left_shift(31, 1) = 62
|
|
left_shift(31, 31) = -2147483648
|
|
left_shift(-31, 0) = -31
|
|
left_shift(-31, 1) = -62
|
|
left_shift(-31, 31) = -2147483648
|
|
left_shift(2147483647, 0) = 2147483647
|
|
left_shift(2147483647, 1) = -2
|
|
left_shift(2147483647, 31) = -2147483648
|
|
left_shift(-2147483648, 0) = -2147483648
|
|
left_shift(-2147483648, 1) = 0
|
|
left_shift(-2147483648, 31) = 0
|
|
|
|
unchecked_left_shift(1, 0) = 1
|
|
unchecked_left_shift(1, 1) = 2
|
|
unchecked_left_shift(1, 31) = -2147483648
|
|
unchecked_left_shift(-1, 0) = -1
|
|
unchecked_left_shift(-1, 1) = -2
|
|
unchecked_left_shift(-1, 31) = -2147483648
|
|
unchecked_left_shift(31, 0) = 31
|
|
unchecked_left_shift(31, 1) = 62
|
|
unchecked_left_shift(31, 31) = -2147483648
|
|
unchecked_left_shift(-31, 0) = -31
|
|
unchecked_left_shift(-31, 1) = -62
|
|
unchecked_left_shift(-31, 31) = -2147483648
|
|
unchecked_left_shift(2147483647, 0) = 2147483647
|
|
unchecked_left_shift(2147483647, 1) = -2
|
|
unchecked_left_shift(2147483647, 31) = -2147483648
|
|
unchecked_left_shift(-2147483648, 0) = -2147483648
|
|
unchecked_left_shift(-2147483648, 1) = 0
|
|
unchecked_left_shift(-2147483648, 31) = 0
|
|
|
|
right_shift(1, 0) = 1
|
|
right_shift(1, 1) = 0
|
|
right_shift(1, 31) = 0
|
|
right_shift(-1, 0) = -1
|
|
right_shift(-1, 1) = -1
|
|
right_shift(-1, 31) = -1
|
|
right_shift(31, 0) = 31
|
|
right_shift(31, 1) = 15
|
|
right_shift(31, 31) = 0
|
|
right_shift(-31, 0) = -31
|
|
right_shift(-31, 1) = -16
|
|
right_shift(-31, 31) = -1
|
|
right_shift(2147483647, 0) = 2147483647
|
|
right_shift(2147483647, 1) = 1073741823
|
|
right_shift(2147483647, 31) = 0
|
|
right_shift(-2147483648, 0) = -2147483648
|
|
right_shift(-2147483648, 1) = -1073741824
|
|
right_shift(-2147483648, 31) = -1
|
|
|
|
unchecked_right_shift(1, 0) = 1
|
|
unchecked_right_shift(1, 1) = 0
|
|
unchecked_right_shift(1, 31) = 0
|
|
unchecked_right_shift(-1, 0) = -1
|
|
unchecked_right_shift(-1, 1) = -1
|
|
unchecked_right_shift(-1, 31) = -1
|
|
unchecked_right_shift(31, 0) = 31
|
|
unchecked_right_shift(31, 1) = 15
|
|
unchecked_right_shift(31, 31) = 0
|
|
unchecked_right_shift(-31, 0) = -31
|
|
unchecked_right_shift(-31, 1) = -16
|
|
unchecked_right_shift(-31, 31) = -1
|
|
unchecked_right_shift(2147483647, 0) = 2147483647
|
|
unchecked_right_shift(2147483647, 1) = 1073741823
|
|
unchecked_right_shift(2147483647, 31) = 0
|
|
unchecked_right_shift(-2147483648, 0) = -2147483648
|
|
unchecked_right_shift(-2147483648, 1) = -1073741824
|
|
unchecked_right_shift(-2147483648, 31) = -1
|
|
|