DEFINITION MODULE MathLib0;

CONST pi      = 3.14159265358979323;
      e       = 2.71828182845904523;

PROCEDURE entier(x : REAL) : INTEGER;

PROCEDURE real(x : INTEGER) : REAL;

PROCEDURE ln(A:REAL):REAL;

PROCEDURE exp(A:REAL):REAL;

PROCEDURE sqrt(A:REAL):REAL;

PROCEDURE sin(A:REAL):REAL;

PROCEDURE cos(A:REAL):REAL;

PROCEDURE tan(A:REAL):REAL;

PROCEDURE arctan(A:REAL):REAL;

PROCEDURE arctan2(A,B:REAL):REAL;

(* arctan2 returns the angle (in radians) with tangent A/B
   arctan2(A,B)=arctan(A/B)

   Also, arctan2 returns a value in the range 0 to 2*pi 
   Whereas arctan returns the value in the range -pi/2..pi/2

   This means that arctan2 can be used directly for rectangular
   to polar co-ordinates. In addition, arctan2 works when B=0.0*)
   
END MathLib0.

