Re: very confused....hex to decimal



you nailed it on all accounts, pretty much.

by the way, the reason i know it should be 685630.9500000000 is that i can use a few other
programs (that i didn't write, <g>) that correctly extract the information. it's a UTM x
coordinate. i'm using the other programs to confirm my results.

lance

"Dick Grier" <dick_grierNOSPAM@xxxxxxx> wrote in message
news:OtqQQjs7FHA.3880@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
>>>
> 4124EC7DE6666666
> <<
>
> Why do you know that this should be 685630.95000000000?
>
> A Hex number can only be converted directly to an Integer, Long, etc. It does not
> represent a non-integral value -- and is a MUCH larger number (as the conversions that
> you observe indicate) than your "expected" result.
>
> You must be attempting to convert the binary representation of a floating point number
> to a floating point decimal representation -- This cannot be done with the code that you
> are using, which, naturally, works only with non-floating point (integral) values.
>
> I think that if you Google, you will find code to convert binary FP numbers to decimal
> FP. The "normal" reason for such conversion is that you are receiving a binary data
> stream from some foreign device, and have to convert it for use in your program. If
> this isn't so, then a more detailed explanation is required.
>
> ***
>
> ***
>
> --
> Richard Grier (Microsoft Visual Basic MVP)
>
> See www.hardandsoftware.net for contact information.
>
> Author of Visual Basic Programmer's Guide to Serial Communications, 4th Edition ISBN
> 1-890422-28-2 (391 pages) published July 2004. See www.mabry.com/vbpgser4 to order.
>
>


.