DeserializeHexReal (FUN) ¶ FUNCTION DeserializeHexReal : BOOL Converts a string of the format R16#{Mantissa}H{Exponent} | R16#NaN | R16#+Inf | R16#-Inf where both mantissa and exponent are hexadecimal numerals, such that liM * 2^iE = {Mantissa} * 16^{Exponent}. Returns true on success and false if the format is invalid or if an overflow occurred (i.e. when the mantissa does not fit into an LINT or the exponent does not fit into an INT.) Note Leading whitespace is not allowed. Any characters that come after the hex real are ignored. See also SerializeHexReal. InOut: Scope Name Type Comment Return DeserializeHexReal BOOL Input ps POINTER TO BYTE Pointer to the input string Output liM LINT The (signed) mantissa iE INT The (unbiased) exponent xNaN BOOL True iff ps^ is ‘F16#NaN’, iE and diM are 0 in this case xInf BOOL True iff ps^ is ‘F16#+Inf’ of ‘F16#-Inf’, diM = 1 for +Infinity and -1 for -Infinity, iE is 0
SerializeHexReal (FUN) ¶ FUNCTION SerializeHexReal : STRING(32) Converts a floating point number to the format R16#{Mantissa}H{Exponent} where both mantissa and exponent are hexadecimal numerals, such that liM * 2^iE = {Mantissa} * 16^{Exponent}. Note If uE is zero, {Exponent} is set to 0, regardless of the value of uE. The hexadecimal exponent is computed as floor(iE/4). The hexadecimal mantissa then becomes liM * 2^(iE mod 4). See also DeSerializeHexReal. InOut: Scope Name Type Comment Return SerializeHexReal STRING(32) Input liM LINT The (signed) mantissa iE INT The (unbiased) exponent
LREAL ¶ GetLRealSpecialVal (Function) IsLRealNaN (Function) IsLRealNegInfinity (Function) IsLRealNumber (Function) IsLRealPosInfinity (Function)
GetLRealSpecialVal (FUN) ¶ FUNCTION GetLRealSpecialVal : LREAL Returns one of the predefined special LREAL values. InOut: Scope Name Type Return GetLRealSpecialVal LREAL Input sv ESpecial_FP_Value
IsLRealNaN (FUN) ¶ FUNCTION IsLRealNaN : BOOL Returns whether the given LREAL value is a special NaN (not a number) value. InOut: Scope Name Type Return IsLRealNaN BOOL Input f LREAL
IsLRealNegInfinity (FUN) ¶ FUNCTION IsLRealNegInfinity : BOOL Returns whether the given LREAL value is a special negative infinity value. InOut: Scope Name Type Return IsLRealNegInfinity BOOL Input f LREAL
IsRealNumber (FUN) ¶ FUNCTION IsRealNumber : BOOL Returns whether the given REAL value is a regular number and not a special NaN or infinity value. InOut: Scope Name Type Return IsRealNumber BOOL Input f REAL
IsRealPosInfinity (FUN) ¶ FUNCTION IsRealPosInfinity : BOOL Returns whether the given REAL value is a special positive infinity value. InOut: Scope Name Type Return IsRealPosInfinity BOOL Input f REAL
StringFunctions ¶ HexStrToLReal (Function) HexStrToReal (Function) LRealToHexStr (Function) LRealToStr (Function) RealToHexStr (Function) RealToStr (Function) StrToLReal (Function) StrToReal (Function)
HexStrToLReal (FUN) ¶ FUNCTION HexStrToLReal : BOOL Converts a HexReal-string to a LREAL value. See DeserializeHexReal for a description of the format. Note This function also handles the case LREAL = REAL. InOut: Scope Name Type Comment Return HexStrToLReal BOOL Input str STRING The string to convert Output f LREAL