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

Bug calculating/rounding Decimals

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Not a Bug
    • 10.0.4
    • None
    • None
    • None
    • Centos 6.3

    Description

      Something is not working correctly on handling decimals. I am still digging to the source, but this example returns NULL and should return 0.

      SELECT
      (ACOS(SIN(RADIANS(26.197506)) * SIN(RADIANS(26.197506)) + COS(RADIANS(26.197506)) * COS(RADIANS(26.197506)) * COS(RADIANS(-80.107953) - RADIANS(-80.107953)))*3959) AS `Distance` 

      However, changing the numbers to one that would not round up if rounded as below returns the proper 0

      SELECT
      (ACOS(SIN(RADIANS(26.197504)) * SIN(RADIANS(26.197504)) + COS(RADIANS(26.197504)) * COS(RADIANS(26.197504)) * COS(RADIANS(-80.107953) - RADIANS(-80.107953)))*3959) AS `Distance` 

      Attachments

        Activity

          People

            serg Sergei Golubchik
            adrianstride Adrian Stride
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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