float equivalent in memoryblock 
Author Message
 float equivalent in memoryblock

I am trying to interpret some binary data which I have stored in a
memory block.  It is a floating point number which is specified to be
a 32-bit IEEE format (1 sign bit, 8 exponent bits, 23 mantissa bits)

In the memoryblock, I am trying to use the singleValue function since
this says it will return a 4 byte float as a double.  However, the
values are coming out wrong.

The binary data is in Little Endian format, so I have set the
littleEndian property to true on the memory block (before I try to
read the float from it, but after I've assigned the data to it).

The value I get isn't completely wrong - it's pretty close.. I'm
getting stuff like 24.59648 instead of 51.  IE, they're in the correct
ballpark at least..

Any ideas on this one?  


Fri, 09 Dec 2005 08:48:44 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Newbie's question: equivalent of .s for floating-point stack

2. Equivalent to Java's Float.MAX_VALUE?

3. MemoryBlock <-> File

4. MemoryBlock question

5. resource to memoryBlock to Text question

6. speed with memoryblock

7. Handle to a MemoryBlock

8. About MemoryBlocks…

9. MemoryBlocks used as properties?

10. Byte() --> MemoryBlock question

11. An alternative to floating point (was Re: Floating point non-exactness)

12. MSBIN float format <-> IEEE float format


Powered by phpBB® Forum Software