Vidíte historickú verziu tejto stránky. Pozrite si aktuálnu verziu.

Porovnať s aktuálnou verziou Zobraziť históriu stránky

Verzia 1 Aktuálny »

%B4ToReal32 function


Function
Function performs the conversion of a binary representation of a 32 bit value of Real type to a value of Real type.
Declaration
REAL %B4ToReal32(
   INT in _b4,
   INT in _b3,
   INT in _b2,
   INT in _b1,
 )

Parameters
_b4 binary representation of value. Bits 24 .. 31 (highest the 4th byte)
_b3 binary representation of value. Bits 16 .. 23
_b2 binary representation of value. Bits 8 .. 15
_b1 binary representation of value. Bits 0 .. 7

Description
The conversion function implements the conversion from the binary representation of the 32 bit real number according to the IEEE 754 standard do to the REAL type value. The binary representation is expressed by _b1 to _b4 values. Values must range from 0 to 255. If the entry does not correspond to the real number according to IEEE 754 standard, the function returns an invalid value.
Example
 REAL _r
 ; platný Float 519.3165
 _r := %B4ToReal32(%StrToI("16#44#"), %StrToI("16#01#"), %StrToI("16#D4#"), %StrToI("16#42#"))

 ; neplatný Float
 _r := %B4ToReal32(%StrToI("16#7F#"), %StrToI("16#C0#"), %StrToI("16#00#"), %StrToI("16#00#")) 

  • Žiadne štítky