sagnikc-dremio opened a new pull request #8398:
URL: https://github.com/apache/arrow/pull/8398


   This patch attempts to resolve the bug introduced by the addition of round() 
in ARROW-9641
   
   round() for floats 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 1.55 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 is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to