Skip to content

Add floor_divide and remainder #56

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

Merged
merged 1 commit into from
Oct 22, 2020
Merged
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
44 changes: 40 additions & 4 deletions spec/API_specification/elementwise_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,6 @@ Calculates the division for each element `x1_i` of the input array `x1` with the

- divisor input array. Must be compatible with `x1` (see :ref:`broadcasting`).

- **out**: _Optional\[ <array> ]_

- output array. If provided, the output array must be compatible with the provided input arrays (see :ref:`broadcasting`). If not provided or is `None`, an uninitialized return array must be created and then filled with the result of each element-wise computation. Default: `None`.

#### Returns

- **out**: _<array>_
Expand Down Expand Up @@ -443,6 +439,26 @@ Rounds each element `x_i` of the input array `x` to the greatest (i.e., closest

- an array containing the rounded result for each element in `x`.

### <a name="floor_divide" href="#floor_divide">#</a> floor_divide(x1, x2, /)

Rounds the result of dividing each element `x1_i` of the input array `x1` by the respective element `x2_i` of the input array `x2` to the greatest (i.e., closest to `+infinity`) integer-value number that is not greater than the division result.

#### Parameters

- **x1**: _&lt;array&gt;_

- dividend input array.

- **x2**: _&lt;array&gt;_

- divisor input array. Must be compatible with `x1` (see :ref:`broadcasting`).

#### Returns

- **out**: _&lt;array&gt;_

- an array containing the element-wise results.

### <a name="greater" href="#greater">#</a> greater(x1, x2, /)

Computes the truth value of `x1_i > x2_i` for each element `x1_i` of the input array `x1` with the respective element `x2_i` of the input array `x2`.
Expand Down Expand Up @@ -839,6 +855,26 @@ Calculates an implementation-dependent approximation of exponentiation by raisin

- an array containing the element-wise results.

### <a name="remainder" href="#remainder">#</a> remainder(x1, x2, /)

Returns the remainder of division for each element `x1_i` of the input array `x1` and the respective element `x2_i` of the input array `x2`.

#### Parameters

- **x1**: _&lt;array&gt;_

- dividend input array.

- **x2**: _&lt;array&gt;_

- divisor input array. Must be compatible with `x1` (see :ref:`broadcasting`).

#### Returns

- **out**: _&lt;array&gt;_

- an array containing the element-wise results. Each element-wise result must have the same sign as the respective element `x2_i`.

### <a name="round" href="#round">#</a> round(x, /)

Rounds each element `x_i` of the input array `x` to the nearest integer-valued number.
Expand Down