kumarUjjawal opened a new issue, #19793:
URL: https://github.com/apache/datafusion/issues/19793

   ### Describe the bug
   
   The  trunc function with a precision argument incorrectly uses rounding 
semantics instead of truncation.
   
   When calling [trunc(value, precision)] where `precision > 0`, the function 
uses `f64::round()` internally instead of `f64::trunc()`, causing values to be 
rounded to the nearest digit rather than truncated towards zero.
   
   
   
   ### To Reproduce
   
   ```sql
   SELECT trunc(3.76, 1);
   
   ### Expected behavior
   
   Should be truncated towards zero instead of rounds to nearest.
   
   ### Additional context
   
   _No response_


-- 
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.

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to