# GeoPoint precision

**URL:** <https://discuss.elastic.co/t/geopoint-precision/62359>\
**Category:** Elasticsearch\
**Created:** [October 6, 2016, 9:44am UTC](https://discuss.elastic.co/t/geopoint-precision/62359 "2016-10-06T09:44:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lessless](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@lessless](https://discuss.elastic.co/u/lessless)\
**Post date:** [October 6, 2016, 9:44am UTC](https://discuss.elastic.co/t/geopoint-precision/62359/1 "2016-10-06T09:44:45Z")

</div>

Hello!

Today we got a strange failure in our application tests : app wrote `10.783551695140882` but got `10.783551695140883` in reply.  
I know that everything after eight number after decimal point doesn't make sense, but it'll be very inconvenient to deal with random results in the tests.

---

<div class="post-metadata">

**Author:** ![mikemccand](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mikemccand](https://discuss.elastic.co/u/mikemccand)\
**Post date:** [October 6, 2016, 10:05am UTC](https://discuss.elastic.co/t/geopoint-precision/62359/2 "2016-10-06T10:05:03Z")

</div>

This is par for the course with floating point numbers.

That number you stored (10.783551695140882) cannot be accurately represented as an IEEE double precision number (which is how Java/Lucene/Elasticsearch encode full precision floats): that last 2 turning into a 3 is the closest double that can be represented.

The truncation gets even worse if you use 4 byte and 2 byte (half) floats.

Mike McCandless

---

<div class="post-metadata">

**Author:** ![lessless](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@lessless](https://discuss.elastic.co/u/lessless)\
**Post date:** [October 7, 2016, 9:04am UTC](https://discuss.elastic.co/t/geopoint-precision/62359/3 "2016-10-07T09:04:51Z")

</div>

Thank you @mikemccand, we truncated number till 8 number after decimal point as an easiest option.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:14pm UTC](https://discuss.elastic.co/t/geopoint-precision/62359/4 "2017-07-05T22:14:06Z")

</div>


