Skip to content

Commit dc65531

Browse files
authored
Add floor_divide and remainder (#56)
1 parent 739e6a4 commit dc65531

File tree

1 file changed

+40
-4
lines changed

1 file changed

+40
-4
lines changed

spec/API_specification/elementwise_functions.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,6 @@ Calculates the division for each element `x1_i` of the input array `x1` with the
371371

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

374-
- **out**: _Optional\[ <array> ]_
375-
376-
- 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`.
377-
378374
#### Returns
379375

380376
- **out**: _<array>_
@@ -473,6 +469,26 @@ Rounds each element `x_i` of the input array `x` to the greatest (i.e., closest
473469

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

472+
### <a name="floor_divide" href="#floor_divide">#</a> floor_divide(x1, x2, /)
473+
474+
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.
475+
476+
#### Parameters
477+
478+
- **x1**: _&lt;array&gt;_
479+
480+
- dividend input array.
481+
482+
- **x2**: _&lt;array&gt;_
483+
484+
- divisor input array. Must be compatible with `x1` (see :ref:`broadcasting`).
485+
486+
#### Returns
487+
488+
- **out**: _&lt;array&gt;_
489+
490+
- an array containing the element-wise results.
491+
476492
### <a name="greater" href="#greater">#</a> greater(x1, x2, /)
477493

478494
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`.
@@ -881,6 +897,26 @@ Calculates an implementation-dependent approximation of exponentiation by raisin
881897

882898
- an array containing the element-wise results.
883899

900+
### <a name="remainder" href="#remainder">#</a> remainder(x1, x2, /)
901+
902+
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`.
903+
904+
#### Parameters
905+
906+
- **x1**: _&lt;array&gt;_
907+
908+
- dividend input array.
909+
910+
- **x2**: _&lt;array&gt;_
911+
912+
- divisor input array. Must be compatible with `x1` (see :ref:`broadcasting`).
913+
914+
#### Returns
915+
916+
- **out**: _&lt;array&gt;_
917+
918+
- an array containing the element-wise results. Each element-wise result must have the same sign as the respective element `x2_i`.
919+
884920
### <a name="round" href="#round">#</a> round(x, /)
885921

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

0 commit comments

Comments
 (0)