You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/10/08 11:57:00 UTC

[jira] [Updated] (ARROW-10234) [C++][Gandiva] Fix logic of round() for floats/decimals in Gandiva

     [ https://issues.apache.org/jira/browse/ARROW-10234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated ARROW-10234:
-----------------------------------
    Labels: pull-request-available  (was: )

> [C++][Gandiva] Fix logic of round() for floats/decimals in Gandiva
> ------------------------------------------------------------------
>
>                 Key: ARROW-10234
>                 URL: https://issues.apache.org/jira/browse/ARROW-10234
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++ - Gandiva
>            Reporter: Sagnik Chakraborty
>            Assignee: Sagnik Chakraborty
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> round() for floats/doubles is returning incorrect results for some edge cases, like round(cast(1.55 as float), 1) gives 1.6, but it should be 1.5, since the result after casting to float comes to 1.5499999523162842, due to inaccurate representation of floating point numbers in memory. Removing an intermediate explicit cast to float statement for a double value, which is used in subsequent computations, minimises the error introduced due to the incorrect representation.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)