Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-2293

Incorrect results when dividing(affects functions like avg too)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • FUN - Functions
    • None

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            James Fang James Fang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: