Click or drag to resize

Bin2F Function

X#
Convert a string containing a 80-bit floating point number to a float value.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION Bin2F(
	cFloat AS STRING
) AS FLOAT
Request Example View Source

Parameters

cFloat
Type: String
An 80-bit floating point number represented as a string — least significant byte first.

Return Value

Type: Float
Remarks
Bin2F() is a conversion function that converts a binary string into a 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 F2Bin().
Examples
This example decrypts a converted floating point numeric back to its original format:
X#
1FUNCTION Start()
2LOCAL cEncrypt AS STRING
3LOCAL fDecrypt AS FLOAT
4cEncrypt := F2Bin(12365789.96587)    // Encrypting
5fDecrypt := Bin2F(cEncrypt)        // Decrypting
6? fDecrypt                        // 12365789.96587
7RETURN TRUE
See Also