
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