All Built-ins

Integers

Arithmetic operations and numeric comparisons

Add(+X, +Y, ?Z)

Adds two integers X and Y, and unifies the result with Z.

Note: X and Y should be instanciated.

Sub(+X, +Y, ?Z)

Subtracts integer Y from integer X, and unifies the result with Z.

Note: X and Y should be instanciated.

Mul(+X, +Y, ?Z)

Multiplies two integers X and Y, and unifies the result with Z.

Note: X and Y should be instanciated.

Div(+X, +Y, ?Z)

Divides integer X by integer Y, and unifies the result with Z.

Note: X and Y should be instanciated. If Y is zero, it will raise an error.

Mod(+X, +Y, ?Z)

Calculates the modulus of integer X by integer Y, and unifies the result with Z.

Note: X and Y should be instanciated. If Y is zero, it will raise an error.

Lt(+X, +Y)

Checks if integer X is less than integer Y.

Note: X and Y should be instanciated.

Lt_eq(+X, +Y)

Checks if integer X is less than or equal to integer Y.

Note: X and Y should be instanciated.

Gt(+X, +Y)

Checks if integer X is greater than integer Y.

Note: X and Y should be instanciated.

Gt_eq(+X, +Y)

Checks if integer X is greater than or equal to integer Y.

Note: X and Y should be instanciated.

Eq_int(+X, +Y)

Checks if integer X is equal to integer Y.

Note: X and Y should be instanciated.

Diff_int(+X, +Y)

Checks if integer X is different from integer Y.

Note: X and Y should be instanciated.

Between(+X, +Y, ?Z)

Checks if integer Z is between integers X and Y, inclusive.

Note: X, Y should be instanciated, and Z should be a variable or an integer.