Coordinate precision problem #310
Replies: 2 comments
-
This is because Print it with a precision of 6 (like |
Beta Was this translation helpful? Give feedback.
0 replies
-
Without using double doubles or something this is unavoidable. That's an error of 2.22e-16 == 1 epsilon, which is basically as good as you can possibly do with IEEE double. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi,all
I found some precision issues
I get S2point first:S2Point point = S2LatLng::FromDegrees(1, 2).ToPoint();
Then I want to get the x coordinate of this point:S2LatLng(*point).lng().degrees();
The result I get is 0.99999999999999978
If I enter a longitude of 56.7, I get 56.699999999999996
I think this is the loss of precision when doing double calculations,
is there any way to solve this?
Beta Was this translation helpful? Give feedback.
All reactions