Converting floating number to the IEEE 32/40-bit precision floating point format 
Author Message
 Converting floating number to the IEEE 32/40-bit precision floating point format

I'm not entirely sure what you want... do you literally want the string
"3E586B9D" or do you want that value in a long integer, or... what?

A VB single is an IEEE 32-bit (4 byte) float.  You can view those 4
bytes in another form by copying the bytes to a long, either using
CopyMemory or LSetting between congruent Type variables.  Once you have
it as a long, you can use Hex$() if you need the string representation.

Type ASingle :  S As Single : End Type
Type ALong : L As Long : End Type
Dim Sng As ASingle
Dim Lng As ALong

Sng.S = 13.5!
LSet Lng = Sng
Debug.Print Lng.L
Debug.Print Hex$(Lng.L)

--
     Jim Mack
     MicroDexterity, Inc

      http://www.*-*-*.com/



Quote:

>Hello there,

>I would appreciate if anyone could any knowledge on function that could
>convert a floating number to the IEEE 32/40-bit precision
>floating point format, eg. -13.5 convert to &H3E586BD9?

>Thank you for all your time.

>Rdgs
>DErek



Fri, 15 Jun 2001 03:00:00 GMT  
 Converting floating number to the IEEE 32/40-bit precision floating point format
Hello there,

I would appreciate if anyone could any knowledge on function that could
convert a floating number to the IEEE 32/40-bit precision
floating point format, eg. -13.5 convert to &H3E586BD9?

Thank you for all your time.

Rdgs
DErek



Sat, 16 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Converting floating point number to IEEE 32-bit precision floating point format

2. convert a 32 bits IEEE floating point

3. convert a 32 bits IEEE floating point

4. convert a 32 bits IEEE floating point

5. converting 32 bit data to IEEE float

6. IEEE 64 Bit Floating Point Date Format

7. 32 Bit Floating Point Numbers

8. Microsoft Binary Format to IEEE Floating Point Format in VB4

9. QB / IEEE single-precision float format.

10. Converting a floating point number from its raw format

11. Floating Point IEEE Numbers

12. Conversion algorithm between IEEE floating point and old Microsoft Binary Format

 

 
Powered by phpBB® Forum Software