Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add i64 variant for exp, ln, log10, log2 and logb functions #628

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions extensions/functions_arithmetic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,13 @@ scalar_functions:
name: "exp"
description: "The mathematical constant e, raised to the power of the value."
impls:
- args:
- name: x
value: i64
options:
rounding:
values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ]
return: fp64
- args:
- name: x
value: fp32
Expand Down
48 changes: 48 additions & 0 deletions extensions/functions_logarithmic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ scalar_functions:
name: "ln"
description: "Natural logarithm of the value"
impls:
- args:
- name: x
value: i64
options:
rounding:
values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ]
on_domain_error:
values: [ NAN, "NULL", ERROR ]
Comment on lines +14 to +15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Domain error here is negative integers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the domain error will be negative integers/floats

on_log_zero:
values: [NAN, ERROR, MINUS_INFINITY]
return: fp64
- args:
- name: x
value: fp32
Expand All @@ -31,6 +42,17 @@ scalar_functions:
name: "log10"
description: "Logarithm to base 10 of the value"
impls:
- args:
- name: x
value: i64
options:
rounding:
values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ]
on_domain_error:
values: [ NAN, "NULL", ERROR ]
on_log_zero:
values: [NAN, ERROR, MINUS_INFINITY]
return: fp64
- args:
- name: x
value: fp32
Expand All @@ -57,6 +79,17 @@ scalar_functions:
name: "log2"
description: "Logarithm to base 2 of the value"
impls:
- args:
- name: x
value: i64
options:
rounding:
values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ]
on_domain_error:
values: [ NAN, "NULL", ERROR ]
on_log_zero:
values: [NAN, ERROR, MINUS_INFINITY]
return: fp64
- args:
- name: x
value: fp32
Expand Down Expand Up @@ -86,6 +119,21 @@ scalar_functions:

logb(x, b) => log_{b} (x)
impls:
- args:
- value: i64
name: "x"
description: "The number `x` to compute the logarithm of"
- value: i64
name: "base"
description: "The logarithm base `b` to use"
options:
rounding:
values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ]
on_domain_error:
values: [ NAN, "NULL", ERROR ]
on_log_zero:
values: [NAN, ERROR, MINUS_INFINITY]
return: fp64
- args:
- value: fp32
name: "x"
Expand Down
Loading