You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Till (JIRA)" <ji...@apache.org> on 2018/03/08 22:27:00 UTC

[jira] [Commented] (ASTERIXDB-2293) Incorrect results when dividing(affects functions like avg too)

    [ https://issues.apache.org/jira/browse/ASTERIXDB-2293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16392013#comment-16392013 ] 

Till commented on ASTERIXDB-2293:
---------------------------------

Currently all fractional digits in AsterixDB are stored as floating point values and the result seems to be correct.

> Incorrect results when dividing(affects functions like avg too)
> ---------------------------------------------------------------
>
>                 Key: ASTERIXDB-2293
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2293
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: FUN - Functions
>            Reporter: James Fang
>            Priority: Minor
>
> I receive incorrect results when dividing. The following queries give the incorrect result in AsterixDB and Couchbase, but gives the correct result in Postgres.
> For example:
> 1) array_avg( [1.2,2.3,3.4] ); 
> 2.3000000000000003
> 2) array_sum( [1.2,2.3,3.4] ) / 3;
> 2.3000000000000003
> 3) 6.9 / 3;
> 2.3000000000000003
>  
> Using the [1.1,2.2,3.3] for 1 and 2, and 6.6 instead of 6.9 in for number 3 gives,
> 2.1999999999999997



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)