Click or drag to resize

Bin2Real8 Function

X#
Convert a string containing a 32-bit floating point number to a Real8 value.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION Bin2Real8(
	cFloat AS STRING
) AS REAL8
Request Example View Source

Parameters

cFloat
Type: String
A 32-bit floating point number represented as a string — least significant byte first. Only the first 8 bytes are used by the function; all others are ignored.

Return Value

Type: Double
Remarks
Bin2Real8() is a conversion function that converts the first 8 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 Real82Bin().
Examples
This example shows that Real82Bin() is the inverse of Bin2Real8():
X#
1cString := Real82Bin(1245633.25)
2? cString                            // 8-byte string
3? Bin2Real8(cString)            // 1245633.25
See Also