Debian Codegraph @

gcc/m2/gm2-libs-iso/RealConv.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 RealConv;
13
14 (* Low-level REAL/string conversions *)
15
16 IMPORT
17 ConvTypes;
18
19 TYPE
20 (* strAllRight, strOutOfRange, strWrongFormat, strEmpty *)
21 ConvResults = ConvTypes.ConvResults;
22
23 PROCEDURE ScanReal (inputCh: CHAR; VAR chClass: ConvTypes.ScanClass;
24 VAR nextState: ConvTypes.ScanState);
25 (* Represents the start state of a finite state scanner for real
26 numbers - assigns class of inputCh to chClass and a procedure
27 representing the next state to nextState.
28 *)
29
30 PROCEDURE FormatReal (str: ARRAY OF CHAR): ConvResults;
31 (* Returns the format of the string value for conversion to REAL. *)
32
33 PROCEDURE ValueReal (str: ARRAY OF CHAR): REAL;
34 (* Returns the value corresponding to the real number string value
35 str if str is well-formed; otherwise raises the RealConv
36 exception.
37 *)
38
39 PROCEDURE LengthFloatReal (real: REAL; sigFigs: CARDINAL): CARDINAL;
40 (* Returns the number of characters in the floating-point string
41 representation of real with sigFigs significant figures.
42 *)
43
44 PROCEDURE LengthEngReal (real: REAL; sigFigs: CARDINAL): CARDINAL;
45 (* Returns the number of characters in the floating-point engineering
46 string representation of real with sigFigs significant figures.
47 *)
48
49 PROCEDURE LengthFixedReal (real: REAL; place: INTEGER): CARDINAL;
50 (* Returns the number of characters in the fixed-point string
51 representation of real rounded to the given place relative to the
52 decimal point.
53 *)
54
55 PROCEDURE IsRConvException (): BOOLEAN;
56 (* Returns TRUE if the current coroutine is in the exceptional
57 execution state because of the raising of an exception in a
58 routine from this module; otherwise returns FALSE.
59 *)
60
61 END RealConv.