RealConv

The regular expression for a signed fixed-point real number is `[+-]?\d+(\.\d* )?'. For the optional exponent part, it is `E[+-]?\d+'.

Import List

    ConvTypes
 
Type Summary
ConvResults = ConvResults

          One of strAllRight, strOutOfRange, strWrongFormat, or strEmpty.
Procedure Summary
FormatReal(ARRAY OF CHAR): ConvResults

          
LengthEngReal(REAL, INTEGER): INTEGER

          
LengthFixedReal(REAL, INTEGER): INTEGER

          
LengthFloatReal(REAL, INTEGER): INTEGER

          
ScanReal(CHAR, VAR ScanClass, VAR ScanState)

          
ValueReal(ARRAY OF CHAR): REAL

          
Constant Summary
strAllRight

          The string format is correct for the corresponding conversion.
strEmpty

          The given string is empty.
strOutOfRange

          The string is well-formed but the value cannot be represented.
strWrongFormat

          The string is in the wrong format for the conversion.

Type Detail

ConvResults

TYPE ConvResults = ConvResults

One of strAllRight, strOutOfRange, strWrongFormat, or strEmpty.

Procedure Detail

FormatReal

PROCEDURE FormatReal(str: ARRAY OF CHAR): ConvResults

LengthEngReal

PROCEDURE LengthEngReal(real: REAL; 
                        sigFigs: INTEGER): INTEGER

LengthFixedReal

PROCEDURE LengthFixedReal(real: REAL; 
                          place: INTEGER): INTEGER

LengthFloatReal

PROCEDURE LengthFloatReal(real: REAL; 
                          sigFigs: INTEGER): INTEGER

ScanReal

PROCEDURE ScanReal(inputCh: CHAR; 
                   VAR chClass: ScanClass; 
                   VAR nextState: ScanState)

ValueReal

PROCEDURE ValueReal(str: ARRAY OF CHAR): REAL
Constant Detail

strAllRight

CONST strAllRight 

The string format is correct for the corresponding conversion.


strEmpty

CONST strEmpty 

The given string is empty.


strOutOfRange

CONST strOutOfRange 

The string is well-formed but the value cannot be represented.


strWrongFormat

CONST strWrongFormat 

The string is in the wrong format for the conversion.