My apologies, the above makes it look like the value 0.33 in the array was 
changed to 0.6600000000000001.  I ran several tests and copied and pasted 
the wrong results.  It actually ends up as:

{
  "first": 0.3300000000000001,
  "second": [
    0.6700000000000004,
    0.5,
    0.33000000000000007
  ]
}

On Friday, July 1, 2016 at 8:31:34 PM UTC-6, Scott B. wrote:
>
> Is anyone else seeing odd behavior with ArangoDB 3.0.1 regarding floating 
> point (Double) numbers?
>
> I had something odd pop-up in my application after moving to ArangoDB 
> 3.0.1.  JSON objects with decimal numbers (like 0.67) were suddenly getting 
> extra precision added to them.  To eliminate as many variables as possible, 
> I saved the following very simply JSON document via the web interface (add 
> document to collection) on both ArangoDB 2.8.9 and ArangoDB 3.0.1:
>
> {
>   "first": 0.33,
>   "second": [
>     0.67,
>     0.33,
>     0.5
>   ]
> }
>
> On ArangoDB 2.8.9, it is saved exactly as expected.  However, on ArangoDB 
> 3.0.1, it gets saved as:
>
> {
>   "first": 0.33000000000000007,
>   "second": [
>     0.6700000000000002,
>     0.5,
>     0.6600000000000001
>   ]
> }
>
> My ArangoDB 3.0.1 server is running on a clean Ubuntu 16.04 LTS install.
>
> My ArangoDB 2.8.9 server is running on Ubuntu 14.04 LTS with a lot of 
> other services/software installed.
>
> I also have the same problem when saving any documents with floating point 
> numbers using the Java driver to 3.0.1 (but it worked fine under 2.8.9).
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to