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
HexStrToReal (FUN) ¶ FUNCTION HexStrToReal : BOOL Converts a HexReal-string to a REAL value. See DeserializeHexReal for a description of the format. InOut: Scope Name Type Comment Return HexStrToReal BOOL Input str STRING The string to convert Output f REAL
LRealToHexStr (FUN) ¶ FUNCTION LRealToHexStr : STRING(32) Converts a LREAL value to a HexReal-string. See SerializeHexReal for a description of the format. Note This function also handles the case LREAL = REAL. InOut: Scope Name Type Return LRealToHexStr STRING(32) Input f LREAL
LRealToStr (FUN) ¶ FUNCTION LRealToStr : STRING(32) Converts LREAL values to a decimal representation, taking into account special values like NaN and infinity. Based on LREAL_TO_STRING. Note This function also handles the case LREAL = REAL. InOut: Scope Name Type Comment Return LRealToStr STRING(32) Input f LREAL The floating point value to convert.
RealToHexStr (FUN) ¶ FUNCTION RealToHexStr : STRING(32) Converts a REAL value to a HexReal-string. See SerializeHexReal for a description of the format. InOut: Scope Name Type Return RealToHexStr STRING(32) Input f REAL
RealToStr (FUN) ¶ FUNCTION RealToStr : STRING(16) Converts REAL values to a decimal representation, taking into account special values like NaN and infinity. Based on REAL_TO_STRING. InOut: Scope Name Type Comment Return RealToStr STRING(16) Input f REAL The floating point value to convert.
StrToLReal (FUN) ¶ FUNCTION StrToLReal : LREAL Converts a string to an LREAL value, taking into account the special values ‘NaN’, ‘+Inf’, and ‘-Inf’. Based on STRING_TO_LREAL. Note This function also handles the case LREAL = REAL. InOut: Scope Name Type Comment Return StrToLReal LREAL Input str STRING The string to convert
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)