IEEE 754 Conversion

Comments

: Is there some source code for converting: numbers to IEEE 754 32 Bit Hex format?:

what you need is a union, but this code does it the hard way - enjoy!Copy and paste into your app. The wrapped around lines should sort themselves out.

Function dword_to_float(ho As Long, lo As Long) As Single'NOTE ho and lo are the 2 16 bit halves of the float'held in longs so that be unsigned (range from 0 to 65535)'IMPORTANT - YOU MUST! PUT a & on the end of each argument when you call this with an &H arg !!!!!!!!!!!!!!'author: [email protected] -- [email protected] UK - ''float format:'bit0 sign'next 8bits are exp+127'rest is 23bit mantissa with assumed binary 1. in front (making 24bits)