Convert a string containing a 32-bit floating point number to a Real4 value.
XSharp.Core (in XSharp.Core.dll) Version: 2.5
cFloat AS STRING
) AS REAL4
public static float Bin2Real4(
- Type: String
A 32-bit floating point number represented as a string — least significant byte first. Only the first 4 bytes are used by the function; all others are ignored.
Bin2Real4() is a conversion function that converts the first 4 bytes of a string to a 32-bit floating point number. Typical applications include reading foreign file types in their native format then saving, reading, decrypting, and transmitting numeric data in their compressed binary form instead of in strings.
Its inverse is Real42Bin().
This example shows that Real42Bin() is the inverse of Bin2Real4():
1cString := Real42Bin(1245633.25)