CeilF (FUN) ¶ FUNCTION CeilF : REAL Returns the smallest integral value that is not less than f. If f is +0, -0, infinity, or NaN, then f is returned. InOut: Scope Name Type Input f REAL Return CeilF REAL
Floor (FUN) ¶ FUNCTION Floor : LREAL Returns the greatest integral value that is not greater than f. if f is +0, -0, infinity, or NaN, then f is returned. Note This function also handles the case LREAL = REAL. InOut: Scope Name Type Input f LREAL Return Floor LREAL
FloorF (FUN) ¶ FUNCTION FloorF : REAL Returns the greatest integral value that is not greater than f. If f is +0, -0, infinity, or NaN, then f is returned. InOut: Scope Name Type Input f REAL Return FloorF REAL
Truncate (FUN) ¶ FUNCTION Truncate : LREAL Round to the next integral value, towards zero. if f is integral, infinity, or NaN, then f is returned. Note This function also handles the case LREAL = REAL. InOut: Scope Name Type Input f LREAL Return Truncate LREAL
TruncateF (FUN) ¶ FUNCTION TruncateF : REAL Round to the next integral value, towards zero. If f is integral, infinity, or NaN, then f is returned. InOut: Scope Name Type Input f REAL Return TruncateF REAL
HexReal ¶ DeserializeHexReal (Function) SerializeHexReal (Function)
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