Is dual ok for geocoordination in Java?

Hi, I want to work with geo coordinates in java.

I defined my Java variables as "double" and my Postgres database is defined as "double precision".

I heard about problems with float that 0.1 result is sometimes at 0.09999 ...

It should store values ​​such as 50.081406 or 8.24481. Values ​​will be read from the Android device.

Do I have to worry about floating point issues?

+3
source share
1 answer

The problem with floats is usually related to adding and subtracting when, due to 2 compliments (how they are stored on the computer), they are not always rounded exactly as you want. This says couples are a great way to keep lat / lon

: /

+4

All Articles