Skip to content

[C++][Python] Remove integer compatibility for trunc, floor and ceil #36786

Closed as not planned

Description

@js8544

Describe the enhancement requested

Follow-up of #36289 (comment). 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, 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++

Activity

  1. pitrou commented on Jul 24, 2023

    @pitrou
    Member

    I'm fine with either removing or keeping integer input support.

    @jorisvandenbossche What do you think?

  2. js8544 commented on Aug 8, 2023

    @js8544
    ContributorAuthor

    cc @jorisvandenbossche would you mind taking a look?

  3. added
    Status: stale-warning
    on Feb 18, 2026
  4. thisisnic commented on Feb 18, 2026

    @thisisnic
    Member

    This issue has been marked as stale because it has had no activity in the past 2 years. Please remove the stale label or comment below, or this issue will be closed in 14 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: C++Status: stale-warningType: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions