previous up next
Go backward to Examples
Go up to Top
Go forward to Integer Laws
RISC-Linz logo

More Arithmetic

|x| := if 0 <= x then x else -x;
 
sign(x) := if x = 0 then 0 else if 0 <= x then 1 else -1;
 
x div y := such q: exists r:
   |r| < |y| /\  x=q*y+r /\  (sign(r) = 0 \/ sign(r)=sign(y));
 
x mod y := such r: exists q:
   |r| < |y| /\  x=q*y+r /\  (sign(r) = 0 \/ sign(r)=sign(y)).

Author: Wolfgang Schreiner
Last Modification: November 16, 1999

previous up next