Skip to content

Commit

Permalink
feat: add logarithmic functions with decimal type args (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
scgkiran authored Aug 1, 2024
1 parent 2aa516b commit d9fb1e3
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions extensions/functions_logarithmic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ scalar_functions:
on_log_zero:
values: [NAN, ERROR, MINUS_INFINITY]
return: fp64
- args:
- name: x
value: decimal<P,S>
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
-
name: "log10"
description: "Logarithm to base 10 of the value"
Expand Down Expand Up @@ -75,6 +86,17 @@ scalar_functions:
on_log_zero:
values: [NAN, ERROR, MINUS_INFINITY]
return: fp64
- args:
- name: x
value: decimal<P,S>
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
-
name: "log2"
description: "Logarithm to base 2 of the value"
Expand Down Expand Up @@ -112,6 +134,17 @@ scalar_functions:
on_log_zero:
values: [NAN, ERROR, MINUS_INFINITY]
return: fp64
- args:
- name: x
value: decimal<P,S>
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
-
name: "logb"
description: >
Expand Down Expand Up @@ -164,6 +197,21 @@ scalar_functions:
on_log_zero:
values: [NAN, ERROR, MINUS_INFINITY]
return: fp64
- args:
- value: decimal<P1,S1>
name: "x"
description: "The number `x` to compute the logarithm of"
- value: decimal<P1,S1>
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
-
name: "log1p"
description: >
Expand Down Expand Up @@ -193,3 +241,14 @@ scalar_functions:
on_log_zero:
values: [NAN, ERROR, MINUS_INFINITY]
return: fp64
- args:
- name: x
value: decimal<P,S>
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

0 comments on commit d9fb1e3

Please sign in to comment.