To answer what precision you use when using float or double, I came up with this answer:
Worst case accuracy when stored as decimal numbers for E / W and N / S:
- float: 1.6955566 meters
- double: 3.1582203519064933E-9 meters. (This is 3 nm)
You can do the calculations yourself by doing this in Java:
public class Main { public static void main(String[] args) { System.out.println(Math.ulp((float) 180) * 60 * 1852); System.out.println(Math.ulp((double) 180) * 60 * 1852); } }
I know this is an old thread, but I found it while searching for a problem. A float is most likely enough for most applications. The GPS device of the Apple device in question probably does not have a higher accuracy than this. But storing duplicates is easier as long as the data is not a problem.
Gussoh
source share