Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-12197

Weird floating point arithmetics issue

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.1.21, 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5(EOL), 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 12.1(EOL)
    • 10.6, 10.11, 11.4, 11.8
    • Data types
    • None
    • MariaDB binary from Alpine Linux 3.5, running in a docker container on an Intel Xeon CPU (E5-2640 stepping 7, 2.50GHz)

    Description

      H know that floating point maths isn't precise, but this particular query on a regular FLOAT field in an InnoDB table can't be explained with precision errors:

      MariaDB [...]> SELECT total, ROUND(`total`, 0) FROM table;
      +---------+-------------------+
      | total   | ROUND(`total`, 0) |
      +---------+-------------------+
      | 5233510 |           5233512 |
      +---------+-------------------+
      1 row in set (0.00 sec)
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            DrMurx Jan Kunzmann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.