

DEFINITION MODULE SUPARITH;

FROM SUPINT IMPORT SuperInteger;

PROCEDURE ShiftLeft
   ( A : SuperInteger;
     k : CARDINAL;
     B : SuperInteger
   );


PROCEDURE ShiftRight
   ( A : SuperInteger;
     k : CARDINAL;
     B : SuperInteger
   );


PROCEDURE CutLeft
   ( A : SuperInteger;
     k : CARDINAL;
     B : SuperInteger
   );


PROCEDURE Log2
   ( A : SuperInteger
   ) : LONGREAL;


PROCEDURE Even
   ( A : SuperInteger
   ) : BOOLEAN;


PROCEDURE Positive
   ( A : SuperInteger
   ) : BOOLEAN;


PROCEDURE Negative
   ( A : SuperInteger
   ) : BOOLEAN;


PROCEDURE Zero
   ( A : SuperInteger
   ) : BOOLEAN;


PROCEDURE Smaller
   ( A, B : SuperInteger
   ) : BOOLEAN;


PROCEDURE Greater
   ( A, B : SuperInteger
   ) : BOOLEAN;


PROCEDURE Equal
   ( A, B : SuperInteger
   ) : BOOLEAN;


PROCEDURE AbsSizeOrd
   ( A, B : SuperInteger
   ) : INTEGER;


PROCEDURE ChangeSign
   ( A, B : SuperInteger
   );


PROCEDURE AbsVal
   ( A, B : SuperInteger
   );


PROCEDURE Add
   ( A, B, C : SuperInteger
   );


PROCEDURE Subtract
   ( A, B, C : SuperInteger
   );


PROCEDURE Multiply
   ( A, B, C : SuperInteger
   );


PROCEDURE MultiplyIntSup
   ( I : LONGINT;
     B, C : SuperInteger
   );


PROCEDURE Divide
   ( A, B, Q, R : SuperInteger
   );


PROCEDURE DivideSupInt
   ( A : SuperInteger;
     B : LONGINT;
     Q : SuperInteger;
     VAR R : LONGINT
   );


PROCEDURE DivideLR (S, T : SuperInteger; VAR equal : BOOLEAN) : LONGREAL;


PROCEDURE DivideRacLR (S, T : SuperInteger) : LONGREAL;


PROCEDURE Quotient
   ( A, B, Q : SuperInteger
   );


PROCEDURE Modulo
   ( A, B, R : SuperInteger
   );


PROCEDURE PowerSupInt
   ( A : SuperInteger;
     I : LONGCARD;
     C : SuperInteger
   );


PROCEDURE GCD
   ( A, B, C : SuperInteger
   );


PROCEDURE Euclide
   ( A, B : SuperInteger;  VAR C, D, E, F, G : SuperInteger
   );


PROCEDURE MultMod
   ( A, B, M, C : SuperInteger
   );


PROCEDURE PowerMod
   ( A, B, M, C : SuperInteger
   );


PROCEDURE DivideMod
   ( A, B, M, C : SuperInteger
   ) : BOOLEAN;


END SUPARITH.
