Debian Codegraph @

gcc/m2/gm2-libs-iso/RealMath.def

raw
1 (* Library module defined by the International Standard
2 Information technology - programming languages
3 BS ISO/IEC 10514-1:1996E Part 1: Modula-2, Base Language.
4
5 Copyright ISO/IEC (International Organization for Standardization
6 and International Electrotechnical Commission) 1996-2021.
7
8 It may be freely copied for the purpose of implementation (see page
9 707 of the Information technology - Programming languages Part 1:
10 Modula-2, Base Language. BS ISO/IEC 10514-1:1996). *)
11
12 DEFINITION MODULE RealMath;
13
14 (* Mathematical functions for the type REAL *)
15
16 CONST
17 pi = 3.1415926535897932384626433832795028841972;
18 exp1 = 2.7182818284590452353602874713526624977572;
19
20 PROCEDURE __BUILTIN__ sqrt (x: REAL): REAL;
21 (* Returns the positive square root of x *)
22
23 PROCEDURE __BUILTIN__ exp (x: REAL): REAL;
24 (* Returns the exponential of x *)
25
26 PROCEDURE __BUILTIN__ ln (x: REAL): REAL;
27 (* Returns the natural logarithm of x *)
28
29 (* The angle in all trigonometric functions is measured in radians *)
30
31 PROCEDURE __BUILTIN__ sin (x: REAL): REAL;
32 (* Returns the sine of x *)
33
34 PROCEDURE __BUILTIN__ cos (x: REAL): REAL;
35 (* Returns the cosine of x *)
36
37 PROCEDURE tan (x: REAL): REAL;
38 (* Returns the tangent of x *)
39
40 PROCEDURE arcsin (x: REAL): REAL;
41 (* Returns the arcsine of x *)
42
43 PROCEDURE arccos (x: REAL): REAL;
44 (* Returns the arccosine of x *)
45
46 PROCEDURE arctan (x: REAL): REAL;
47 (* Returns the arctangent of x *)
48
49 PROCEDURE power (base, exponent: REAL) : REAL;
50 (* Returns the value of the number base raised to the power exponent *)
51
52 PROCEDURE round (x: REAL) : INTEGER;
53 (* Returns the value of x rounded to the nearest integer *)
54
55 PROCEDURE IsRMathException () : BOOLEAN;
56 (* Returns TRUE if the current coroutine is in the exceptional execution state
57 because of the raising of an exception in a routine from this module; otherwise
58 returns FALSE.
59 *)
60
61 END RealMath.
62