home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / ISOsym / realconv.def < prev    next >
Text File  |  1996-08-29  |  2KB  |  57 lines

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