RealInOut.def 841 B

123456789101112131415161718192021222324252627282930
  1. DEFINITION MODULE RealInOut;
  2. (*
  3. Module: InOut for REAL numbers
  4. From: "Programming in Modula-2", 3rd, corrected edition, by N. Wirth
  5. Version: $Header$
  6. *)
  7. VAR Done: BOOLEAN;
  8. PROCEDURE ReadReal(VAR x: REAL);
  9. (* Read a real number "x" according to the syntax:
  10. ['+'|'-'] digit {digit} ['.' digit {digit}]
  11. [('E'|'e') ['+'|'-'] digit {digit}]
  12. Done := "a number was read".
  13. Input terminates with a blank or any control character.
  14. When reading from a terminal, backspacing may be done by either
  15. DEL or BACKSPACE, depending on the implementation of ReadString.
  16. *)
  17. PROCEDURE WriteReal(x: REAL; n: CARDINAL);
  18. (* Write x using n characters.
  19. If fewer than n characters are needed, leading blanks are inserted.
  20. *)
  21. PROCEDURE WriteRealOct(x: REAL);
  22. (* Write x in octal words.
  23. *)
  24. END RealInOut.