Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-22182

Incorrect round when dividing decimals

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.12.2
    • None
    • Table SQL / Runtime
    • None

    Description

      Hi,

      I have following problem:
      This query:

      select ((CAST(28604 as decimal(38,4)))/(cast(451 as decimal(38,4))) - 1121)/10 ;
      

      Gives following answer:

      -105.757650000000000000
      

      Correct answer should be:

      -105,75764966740576496674057649667
      

      Why the result is rounded to 5th decimal place ?

      Saving both values back to Decimal(38,4) column will give different results: -105.7577 vs -105.7576 (where second one is correct)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              maver1ck Maciej BryƄski
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: