(*
    Title: 	Arithmetic - Definitions
    LastEdit:	"Mon Sep 17 14:06:55 1984"
    Author: 	pr
		Cambridge University Computer Laboratory
*)
DEFINITION MODULE Arithmetic;

EXPORT QUALIFIED
    CMax, CMin,
    ISign, IMax, IMin,
    Fix, RSign, RMax, RMin,
    SquareRoot, Round (*, ImaginarySquareRoot *);

PROCEDURE CMax (x, y: CARDINAL): CARDINAL;
PROCEDURE CMin (x, y: CARDINAL): CARDINAL;

PROCEDURE ISign (x: INTEGER): INTEGER;
(*  returns -1 if x<0, +1 otherwise *)
PROCEDURE IMax (x, y: INTEGER): INTEGER;
PROCEDURE IMin (x, y: INTEGER): INTEGER;

PROCEDURE Fix (x: REAL): INTEGER;
PROCEDURE RSign (x: REAL): REAL;
(*  returns -1.0 if x<0, +1.0 otherwise *)
PROCEDURE RMax (x, y: REAL): REAL;
PROCEDURE RMin (x, y: REAL): REAL;

(* EXCEPTION ImaginarySquareRoot *)

PROCEDURE SquareRoot (x: REAL): REAL (* RAISES {ImaginarySquareRoot} *);

PROCEDURE Round (x: REAL): INTEGER;

END Arithmetic.
