Re: [OpenMap Users] Floats Vs. Doubles

From: Nicholas Wright <nick.wright@ist.co.uk>
Date: Fri Dec 05 2003 - 04:49:54 EST

Hi

The biggest problem with floats is not the acurracy when representing
something on the map per-se. It's the problem with using floats in
calculations. I remember watching my 'C' program output the answer 2.99 to
the code:

    float f = 1.5;
    float g = 1.5;
    float c = f+g; // c = 2.99

in complete disbelief until I read it was designed that way.

I think Martin is lucky that his floats were *just* truncated. Searching
through hundreds of lines of code for one inaccuracy like the above, is far
more infuriating.

It's a shame the handy LatLonPoint class is float based.

Regards,

Nicholas

----- Original Message -----
From: "Christof Dallermassl" <cdaller@iicm.tu-graz.ac.at>
To: "Nicholas Wright" <nick.wright@ist.co.uk>
Cc: <openmap-users@bbn.com>; "Martin Chapman" <mchapman@sanz.com>
Sent: Friday, December 05, 2003 8:35 AM
Subject: Re: [OpenMap Users] Floats Vs. Doubles

> Hi!
>
> Nicholas> I didn't see an answer to this question. Apologies if I
> Nicholas> have missed.
>
> Nicholas> Why are floats used instead of doubles?
>
> yes, I'd prefer doubles as well! I know, it is probably diffikult to
> change now...
>
> another thing is that two LatLonPoints are not equal, if their
> coordinates differ on 0.00001f. Could you decrease this factor?
>
>
> mit freundlichen Gruessen
> Christof
> --
> --------------------------------------------------------------------------
-
> Christof Dallermassl / Institute for Information Processing and
Computer
> cdaller@iicm.edu / Supported new Media, Graz University of
Technology
> --------------------------------------------------------------------------
-
> Dino Developer Community - be a part of it - http://www.dinopolis.org
>

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Dec 5 04:49:48 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:37 EDT