1988-02-19 15:54:01 +00:00
|
|
|
(*
|
|
|
|
(c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*)
|
|
|
|
|
1987-08-19 18:07:01 +00:00
|
|
|
(*$R-*)
|
1987-05-13 14:36:45 +00:00
|
|
|
IMPLEMENTATION MODULE MathLib0;
|
1988-02-19 15:54:01 +00:00
|
|
|
(*
|
|
|
|
Module: Some mathematical functions
|
|
|
|
Author: Ceriel J.H. Jacobs
|
1994-06-24 14:02:31 +00:00
|
|
|
Version: $Id$
|
1988-02-19 15:54:01 +00:00
|
|
|
*)
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1991-03-05 13:47:08 +00:00
|
|
|
IMPORT Mathlib;
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1991-03-05 13:47:08 +00:00
|
|
|
PROCEDURE cos(arg: REAL): REAL;
|
|
|
|
BEGIN
|
1987-05-27 10:05:01 +00:00
|
|
|
RETURN Mathlib.cos(arg);
|
1991-03-05 13:47:08 +00:00
|
|
|
END cos;
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1991-03-05 13:47:08 +00:00
|
|
|
PROCEDURE sin(arg: REAL): REAL;
|
|
|
|
BEGIN
|
1987-05-27 10:05:01 +00:00
|
|
|
RETURN Mathlib.sin(arg);
|
1991-03-05 13:47:08 +00:00
|
|
|
END sin;
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1991-03-05 13:47:08 +00:00
|
|
|
PROCEDURE arctan(arg: REAL): REAL;
|
|
|
|
BEGIN
|
1987-05-27 10:05:01 +00:00
|
|
|
RETURN Mathlib.arctan(arg);
|
1991-03-05 13:47:08 +00:00
|
|
|
END arctan;
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1991-03-05 13:47:08 +00:00
|
|
|
PROCEDURE sqrt(arg: REAL): REAL;
|
|
|
|
BEGIN
|
1987-05-27 10:05:01 +00:00
|
|
|
RETURN Mathlib.sqrt(arg);
|
1991-03-05 13:47:08 +00:00
|
|
|
END sqrt;
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1991-03-05 13:47:08 +00:00
|
|
|
PROCEDURE ln(arg: REAL): REAL;
|
|
|
|
BEGIN
|
1987-05-27 10:05:01 +00:00
|
|
|
RETURN Mathlib.ln(arg);
|
1991-03-05 13:47:08 +00:00
|
|
|
END ln;
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1991-03-05 13:47:08 +00:00
|
|
|
PROCEDURE exp(arg: REAL): REAL;
|
|
|
|
BEGIN
|
1987-05-27 10:05:01 +00:00
|
|
|
RETURN Mathlib.exp(arg);
|
1991-03-05 13:47:08 +00:00
|
|
|
END exp;
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1991-03-05 13:47:08 +00:00
|
|
|
PROCEDURE entier(x: REAL): INTEGER;
|
1987-10-19 10:06:24 +00:00
|
|
|
VAR i: INTEGER;
|
1991-03-05 13:47:08 +00:00
|
|
|
BEGIN
|
1987-07-22 12:42:10 +00:00
|
|
|
IF x < 0.0 THEN
|
1987-10-19 10:06:24 +00:00
|
|
|
i := TRUNC(-x);
|
1989-11-28 14:16:38 +00:00
|
|
|
IF FLOAT(i) = -x THEN
|
1989-11-27 09:37:56 +00:00
|
|
|
RETURN -i;
|
|
|
|
ELSE
|
|
|
|
RETURN -i -1;
|
|
|
|
END;
|
1987-07-22 12:42:10 +00:00
|
|
|
END;
|
|
|
|
RETURN TRUNC(x);
|
1991-03-05 13:47:08 +00:00
|
|
|
END entier;
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1991-03-05 13:47:08 +00:00
|
|
|
PROCEDURE real(x: INTEGER): REAL;
|
|
|
|
BEGIN
|
1987-07-22 12:42:10 +00:00
|
|
|
IF x < 0 THEN
|
|
|
|
RETURN - FLOAT(-x);
|
|
|
|
END;
|
|
|
|
RETURN FLOAT(x);
|
1991-03-05 13:47:08 +00:00
|
|
|
END real;
|
1987-05-13 14:36:45 +00:00
|
|
|
|
|
|
|
BEGIN
|
|
|
|
END MathLib0.
|