Result is Number1 // Number2which should be preferred for portability.
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)).
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) //( 10, 3, 3). //(-10, 3, -3). //( 10, -3, -3). //(-10, -3, 3). Fail: //(1, 2, 3). //(5, 2, 2.0). //(5, 2, r). Error: //(A, 2, 6). (Error 4). //(6, 2.0, 3.0). (Error 5). //(2, 0, Result). (Error 20). //(4 + 2, 2, 12). (Error 24).