Skip to content

Commit

Permalink
fix: renaimed quotient to division_type for clarity. removed CEILING,…
Browse files Browse the repository at this point in the history
… EUCLIDIAN, and ROUND
  • Loading branch information
jordanvieler committed Dec 14, 2023
1 parent 6f5a986 commit debc8f0
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions extensions/functions_arithmetic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,13 @@ scalar_functions:
(3) abs(r) < abs(y)
where q is the quotient.
The `quotient` option determines the mathematical definition of quotient to use in the above definition of
The `division_type` option determines the mathematical definition of quotient to use in the above definition of
division.
When `quotient`=TRUNCATE, q = trunc(x/y).
When `quotient`=FLOOR, q = floor(x/y).
When `quotient`=CEILING, q = ceil(x/y).
When `quotient`=ROUND, q = round(x/y), where the round function is rounding half to even.
When `quotient`=EUCLIDIAN, q = sign(y) * floor(x/abs(y))
When `division_type`=TRUNCATE, q = trunc(x/y).
When `division_type`=FLOOR, q = floor(x/y).
In the case of TRUNCATE, FLOOR, AND CEILING division: remainder r = x - round_func(x/y)
In the case of EUCLIDIAN division: remainder r = x - abs(y)*floor(x/abs(y))
In the cases of TRUNCATE and FLOOR division: remainder r = x - round_func(x/y)
The `on_domain_error` option governs behavior in cases where y is 0, y is +/-inf, or x is +/-inf. In these cases
modulo is undefined.
Expand All @@ -322,21 +318,20 @@ scalar_functions:
- name: y
value: i8
options:
quotient:
values: [ TRUNCATE, FLOOR, CEILING, ROUND, EUCLIDEAN ]
division_type:
values: [ TRUNCATE, FLOOR ]
overflow:
values: [ SILENT, SATURATE, ERROR ]
on_domain_error:
values: [ NAN, ERROR ]
on_domain_error: values: [ NAN, ERROR ]

Check failure on line 325 in extensions/functions_arithmetic.yaml

View workflow job for this annotation

GitHub Actions / Lint YAML extensions

325:34 syntax error: mapping values are not allowed here (syntax)
return: i8
- args:
- name: x
value: i16
- name: y
value: i16
options:
quotient:
values: [ TRUNCATE, FLOOR, CEILING, ROUND, EUCLIDEAN ]
division_type:
values: [ TRUNCATE, FLOOR ]
overflow:
values: [ SILENT, SATURATE, ERROR ]
on_domain_error:
Expand All @@ -348,8 +343,8 @@ scalar_functions:
- name: y
value: i32
options:
quotient:
values: [ TRUNCATE, FLOOR, CEILING, ROUND, EUCLIDEAN ]
division_type:
values: [ TRUNCATE, FLOOR ]
overflow:
values: [ SILENT, SATURATE, ERROR ]
on_domain_error:
Expand All @@ -361,8 +356,8 @@ scalar_functions:
- name: y
value: i64
options:
quotient:
values: [ TRUNCATE, FLOOR, CEILING, ROUND, EUCLIDEAN ]
division_type:
values: [ TRUNCATE, FLOOR ]
overflow:
values: [ SILENT, SATURATE, ERROR ]
on_domain_error:
Expand Down

0 comments on commit debc8f0

Please sign in to comment.