-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add functions for arithmetic, rounding, logarithmic, and string…
… transformations (#245) * feat: add functions for arithmetic, rounding, logarithmic, and string transformations Co-authored-by: Sanjiban Sengupta <[email protected]>
- Loading branch information
1 parent
42d9ca3
commit f7c5da5
Showing
5 changed files
with
220 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
%YAML 1.2 | ||
--- | ||
scalar_functions: | ||
- | ||
name: "ln" | ||
description: "Natural logarithm of the value" | ||
impls: | ||
- args: | ||
- name: rounding | ||
options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] | ||
required: false | ||
- name: on_domain_error | ||
options: [ NAN, ERROR ] | ||
required: false | ||
- value: fp32 | ||
return: fp32 | ||
- args: | ||
- name: rounding | ||
options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] | ||
required: false | ||
- name: on_domain_error | ||
options: [ NAN, ERROR ] | ||
required: false | ||
- value: fp64 | ||
return: fp64 | ||
- | ||
name: "log10" | ||
description: "Logarithm to base 10 of the value" | ||
impls: | ||
- args: | ||
- name: rounding | ||
options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] | ||
required: false | ||
- name: on_domain_error | ||
options: [ NAN, ERROR ] | ||
required: false | ||
- value: fp32 | ||
return: fp32 | ||
- args: | ||
- name: rounding | ||
options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] | ||
required: false | ||
- name: on_domain_error | ||
options: [ NAN, ERROR ] | ||
required: false | ||
- value: fp64 | ||
return: fp64 | ||
- | ||
name: "log2" | ||
description: "Logarithm to base 2 of the value" | ||
impls: | ||
- args: | ||
- name: rounding | ||
options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] | ||
required: false | ||
- name: on_domain_error | ||
options: [ NAN, ERROR ] | ||
required: false | ||
- value: fp32 | ||
return: fp32 | ||
- args: | ||
- name: rounding | ||
options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] | ||
required: false | ||
- name: on_domain_error | ||
options: [ NAN, ERROR ] | ||
required: false | ||
- value: fp64 | ||
return: fp64 | ||
- | ||
name: "logb" | ||
description: > | ||
Logarithm of the value with the given base | ||
logb(x, b) => log_{b} (x) | ||
impls: | ||
- args: | ||
- name: rounding | ||
options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] | ||
required: false | ||
- name: on_domain_error | ||
options: [ NAN, ERROR ] | ||
required: false | ||
- value: fp32 | ||
name: "x" | ||
description: "The number `x` to compute the logarithm of" | ||
- value: fp32 | ||
name: "base" | ||
description: "The logarithm base `b` to use" | ||
return: fp32 | ||
- args: | ||
- name: rounding | ||
options: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] | ||
required: false | ||
- name: on_domain_error | ||
options: [ NAN, ERROR ] | ||
required: false | ||
- value: fp64 | ||
name: "x" | ||
description: "The number `x` to compute the logarithm of" | ||
- value: fp64 | ||
name: "base" | ||
description: "The logarithm base `b` to use" | ||
return: fp64 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
%YAML 1.2 | ||
--- | ||
scalar_functions: | ||
- | ||
name: "ceil" | ||
description: "Rounding to the ceiling of the value" | ||
impls: | ||
- args: | ||
- value: fp32 | ||
return: fp32 | ||
- args: | ||
- value: fp64 | ||
return: fp64 | ||
- | ||
name: "floor" | ||
description: "Rounding to the floor of the value" | ||
impls: | ||
- args: | ||
- value: fp32 | ||
return: fp32 | ||
- args: | ||
- value: fp64 | ||
return: fp64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters