
Double to Byte Array and Back
Thanks for the reply Jim. At least now I understand why I see the
workarounds for this issue. (And why the decimal point kept moving
around on me). I spent the last two weeks with my 8th grade Geometry
book (circa 1971), lord knows which one I'll have to dig out for this
<g>.
Quote:
>IEEE doubles are complicated. They're stored in 8 bytes, laid out like
>this (the order of bytes is reversed here for clarity):
> SEEEEEE EEEEMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM .....
>...where S is the sign bit, EEE are exponent bits, and MMM are mantissa
>bits.
I'm thinking not so bad then I read the next line....I'm easily
confused <g>
Quote:
>The exponent is biased +1023, and the MSB of the mantissa is implied.
Most assuredly, (been cheating here with VBHelp32.dll or VBUtil.DLL)
Quote:
>Decoding these is not trivial, and even less so in a language like VB
>that has minimal support for masking and shifting.
> -- Jim
I certainly hate using VB's "Type Coercion" or the "out to file and
back" workaround though.
Thanks for your time,
dj