home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xco212p.zip / ISODEF / srealio.def < prev    next >
Text File  |  1994-12-22  |  2KB  |  47 lines

  1. DEFINITION MODULE SRealIO;
  2.  
  3.   (* Input and output of real numbers in decimal text form over default
  4.      channels.  The read result is of the type IOConsts.ReadResults.
  5.   *)
  6.  
  7.   (* The text form of a signed fixed-point real number is
  8.        ["+" | "-"], decimal digit, {decimal digit},
  9.        [".", {decimal digit}]
  10.  
  11.      The text form of a signed floating-point real number is
  12.        signed fixed-point real number,
  13.        "E", ["+" | "-"], decimal digit, {decimal digit}
  14.   *)
  15.  
  16. PROCEDURE ReadReal (VAR real: REAL);
  17.   (* Skips leading spaces, and removes any remaining characters from the default input
  18.      channel that form part of a signed fixed or floating point number. The value of this
  19.      number is assigned to real.  The read result is set to the value allRight, outOfRange,
  20.      wrongFormat, endOfLine, or endOfInput.
  21.   *)
  22.  
  23. PROCEDURE WriteFloat (real: REAL; sigFigs: CARDINAL; width: CARDINAL);
  24.   (* Writes the value of real to the default output channel in floating-point text form,
  25.      with sigFigs significant figures, in a field of the given minimum width.
  26.   *)
  27.  
  28. PROCEDURE WriteEng (real: REAL; sigFigs: CARDINAL; width: CARDINAL);
  29.   (* As for WriteFloat, except that the number is scaled with one to three digits in the
  30.      whole number part, and with an exponent that is a multiple of three.
  31.   *)
  32.  
  33. PROCEDURE WriteFixed (real: REAL; place: INTEGER; width: CARDINAL);
  34.   (* Writes the value of real to the default output channel in fixed-point text form,
  35.      rounded to the given place relative to the decimal point, in a field of the given
  36.      minimum width.
  37.   *)
  38.  
  39. PROCEDURE WriteReal (real: REAL; width: CARDINAL);
  40.   (* Writes the value of real to the default output channel, as WriteFixed if the sign and
  41.      magnitude can be shown in the given width, or otherwise as WriteFloat. The number of
  42.      places or significant digits depends on the given width.
  43.   *)
  44.  
  45. END SRealIO.
  46.  
  47.