[
https://issues.apache.org/jira/browse/FLINK-22182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maciej Bryński updated FLINK-22182:
-----------------------------------
Summary: Incorrect round when dividing decimals (was: Incorrect round when
dividing two decimals)
> Incorrect round when dividing decimals
> --------------------------------------
>
> Key: FLINK-22182
> URL: https://issues.apache.org/jira/browse/FLINK-22182
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Runtime
> Affects Versions: 1.12.2
> Reporter: Maciej Bryński
> Priority: Major
>
> Hi,
> I have following problem:
> This query:
> {code:java}
> select ((CAST(28604 as decimal(38,4)))/(cast(451 as decimal(38,4))) -
> 1121)/10 ;
> {code}
> Gives following answer:
> {code:java}
> -105.757650000000000000
> {code}
> Correct answer should be:
> {code:java}
> -105,75764966740576496674057649667
> {code}
> 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)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)