This division operates on integer arguments, and delivers an integer result rounded towards zero (truncated). The corresponding remainder is computed by the rem operation, such that the following equivalence always holds:
X =:= (X rem Y) + (X // Y) * Y.
The relationship with floating-point division is:
X // Y =:= integer(truncate(X/Y)).
This predicate can be used as a function in arithmetic expressions. In coroutining mode, if Number1 or Number2 are uninstantiated, the call to (//)/3 is delayed until these variables are instantiated.
Success:
X is 10 // 3. % gives X = 3
X is -10 // 3. % gives X = -3
X is 10 // -3. % gives X = -3
X is -10 // -3. % gives X = 3
Error:
X is 2//0. % arithmetic exception