1 DEFINITION MODULE RealInOut;
3 Module: InOut for REAL numbers
4 From: "Programming in Modula-2", 3rd, corrected edition, by N. Wirth
5 Version: $Id: RealInOut.def,v 1.6 1994/06/24 12:49:28 ceriel Exp $
10 PROCEDURE ReadReal(VAR x: REAL);
11 (* Read a real number "x" according to the syntax:
13 ['+'|'-'] digit {digit} ['.' digit {digit}]
14 [('E'|'e') ['+'|'-'] digit {digit}]
16 Done := "a number was read".
17 Input terminates with a blank or any control character.
18 When reading from a terminal, backspacing may be done by either
19 DEL or BACKSPACE, depending on the implementation of ReadString.
22 PROCEDURE ReadLongReal(VAR x: LONGREAL);
23 (* Like ReadReal, but for LONGREAL *)
25 PROCEDURE WriteReal(x: REAL; n: CARDINAL);
26 (* Write x using n characters.
27 If fewer than n characters are needed, leading blanks are inserted.
30 PROCEDURE WriteLongReal(x: LONGREAL; n: CARDINAL);
31 (* Like WriteReal, but for LONGREAL *)
33 PROCEDURE WriteFixPt(x: REAL; n, k: CARDINAL);
34 (* Write x in fixed-point notation usign n characters with k digits
35 after the decimal point. If fewer than n characters are needed,
36 leading blanks are inserted.
39 PROCEDURE WriteLongFixPt(x: LONGREAL; n, k: CARDINAL);
40 (* Like WriteFixPt, but for LONGREAL *)
42 PROCEDURE WriteRealOct(x: REAL);
43 (* Write x in octal words.
46 PROCEDURE WriteLongRealOct(x: LONGREAL);
47 (* Like WriteRealOct, but for LONGREAL *)