Repository navigation
8000
div>
Expand file tree
/
Copy pathMathLib0.mod
More file actions
executable file
·69 lines (58 loc) · 1.12 KB
/
Copy pathMathLib0.mod
File metadata and controls
executable file
·69 lines (58 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
(*
(c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
See the copyright notice in the ACK home directory, in the file "Copyright".
*)
(*$R-*)
IMPLEMENTATION MODULE MathLib0;
(*
Module: Some mathematical functions
Author: Ceriel J.H. Jacobs
Version: $Header$
*)
IMPORT Mathlib;
PROCEDURE cos(arg: REAL): REAL;
BEGIN
RETURN Mathlib.cos(arg);
END cos;
PROCEDURE sin(arg: REAL): REAL;
BEGIN
RETURN Mathlib.sin(arg);
END sin;
PROCEDURE arctan(arg: REAL): REAL;
BEGIN
RETURN Mathlib.arctan(arg);
END arctan;
PROCEDURE sqrt(arg: REAL): REAL;
BEGIN
RETURN Mathlib.sqrt(arg);
END sqrt;
PROCEDURE ln(arg: REAL): REAL;
BEGIN
RETURN Mathlib.ln(arg);
END ln;
PROCEDURE exp(arg: REAL): REAL;
BEGIN
RETURN Mathlib.exp(arg);
END exp;
PROCEDURE entier(x: REAL): INTEGER;
VAR i: INTEGER;
BEGIN
IF x < 0.0 THEN
i := TRUNC(-x);
IF FLOAT(i) = -x THEN
RETURN -i;
ELSE
RETURN -i -1;
END;
END;
RETURN TRUNC(x);
END entier;
PROCEDURE real(x: INTEGER): REAL;
BEGIN
IF x < 0 THEN
RETURN - FLOAT(-x);
END;
RETURN FLOAT(x);
END real;
BEGIN
END MathLib0.