js8544 opened a new issue, #36786:
URL: https://github.com/apache/arrow/issues/36786

   ### Describe the enhancement requested
   
   Follow-up of 
https://github.com/apache/arrow/pull/36289#discussion_r1267909098. I am in 
favor of removing integer compatibility for `trunc`, `floor` and `ceil` for the 
following reasons:
   1. Mathematically they are no-ops for integers, so it doesn't make much 
sense to support them as a function.
   2. The current implementation casts ints to floats, which may yield 
unexpected results due to float precision issues.
   3. It's very simple to remove it, by just deleting several lines of code, as 
@jorisvandenbossche mentioned 
[here](https://github.com/apache/arrow/pull/36289#discussion_r1267931632), 
along with some small changes in tests and docs.
   4. The support for integers was probably unintentional, just like the case 
for `round`.
   
   The downside is, all the SQL engines, along with Numpy and R, support 
floor(int), and the result type is double, which means our current 
implementation is consistent with them.
   
   cc @pitrou @jorisvandenbossche @westonpace 
   
   ### Component(s)
   
   C++


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

Reply via email to