Skip to content

power(decimal, -integer) is incorrect #22510

Closed

Description

@neilconway

Describe the bug

power with a decimal base and negative integer exponent truncates the result incorrectly.

To Reproduce

DataFusion CLI v53.1.0
> select power(CAST(2 AS DECIMAL(10,0)), -3);
+---------------------------+
| power(Int64(2),Int64(-3)) |
+---------------------------+
| 0                         |
+---------------------------+
1 row(s) fetched.
Elapsed 0.110 seconds.

Expected behavior

This query should return 0.125, which is what Postgres and DuckDB do.

Additional context

No response

Activity

  1. added theissue type on May 25, 2026
  2. neilconway commented on May 25, 2026

    @neilconway
    ContributorAuthor

    take

  3. added a commit that references this issue on Jun 4, 2026
    7ed9a0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions