F42Bin - Create the binary representation of a single precision float

Top  Previous  Next

Syntax

 

<cFloat4> := F42Bin( <nFloat> )

 

Parameters

 

<nFloat4>

 

Single precision C float value represented by an Xbase++ numeric to be converted to a binary string value.

 

Return value

 

The bit representation of the single precision numeric value contained in <nFloat>.

 

Description

 

F42Bin converts a single precision float value to a string containing its binary representation.

 

Classification

 

Core

 

Category

 

Type Conversion

 

Quick Info

 

Library: cckptcor.lib / cckptcor.dll

 

See also

 

Bin2F4

 

Example

 

 

#INCLUDE "CockpitCoreLibs.ch"

 

FUNCTION Main

 

LOCAL n1,n2,f

 

* This is our test value

n1 := 1.234

 

* Now let's get its binary representation

f := F42Bin(n1)

 

* What does it look like?

? HexString(f)

 

* Convert back to a single precision float

n2 := Bin2F4(f)

 

* Is it identical?

? n2

 

RETURN NIL