Skip to content

power(decimal, float) should return float #22472

Closed

Description

@neilconway

Describe the bug

At present, power(decimal, float) returns a decimal , which leads to problematic behavior:

> SELECT power(cast(2.5 as decimal(2,1)), 4.0);
+--------------------------------+
| power(Float64(2.5),Float64(4)) |
+--------------------------------+
| 3.9                            |
+--------------------------------+
1 row(s) fetched.
Elapsed 0.004 seconds.
> SELECT power(cast(2.5 as decimal), 4.0);
Arrow error: Arithmetic overflow: Cannot raise base 25000000000 to exp 4

To Reproduce

No response

Expected behavior

Both queries should return 39.0625, and probably of type Float64.

Additional context

No response

Activity

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

    @neilconway
    ContributorAuthor

    take

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