Skip to content

Commit 424fb71

Browse files
authored
Add negative and positive element-wise specs (#55)
1 parent 9ef5b5d commit 424fb71

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

spec/API_specification/elementwise_functions.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,22 @@ Calculates the product for each element `x1_i` of the input array `x1` with the
831831

832832
- an array containing the element-wise products.
833833

834+
### <a name="negative" href="#negative">#</a> negative(x, /)
835+
836+
Computes the numerical negative of each element `x_i` (i.e., `y_i = -x_i`) of the input array `x`.
837+
838+
#### Parameters
839+
840+
- **x**: _&lt;array&gt;_
841+
842+
- input array.
843+
844+
#### Returns
845+
846+
- **out**: _&lt;array&gt;_
847+
848+
- an array containing the evaluated result for each element in `x`. The returned array must have a supported numerical data type.
849+
834850
### <a name="not_equal" href="#not_equal">#</a> not_equal(x1, x2, /)
835851

836852
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`.
@@ -851,6 +867,22 @@ Computes the truth value of `x1_i != x2_i` for each element `x1_i` of the input
851867

852868
- an array containing the element-wise results.
853869

870+
### <a name="positive" href="#positive">#</a> positive(x, /)
871+
872+
Computes the numerical positive of each element `x_i` (i.e., `y_i = +x_i`) of the input array `x`.
873+
874+
#### Parameters
875+
876+
- **x**: _&lt;array&gt;_
877+
878+
- input array.
879+
880+
#### Returns
881+
882+
- **out**: _&lt;array&gt;_
883+
884+
- an array containing the evaluated result for each element in `x`. The returned array must have a supported numerical data type.
885+
854886
### <a name="pow" href="#pow">#</a> pow(x1, x2, /)
855887

856888
Calculates an implementation-dependent approximation of exponentiation by raising each element `x1_i` (the base) of the input array `x1` to the power of `x2_i` (the exponent), where `x2_i` is the corresponding element of the input array `x2`.
@@ -959,7 +991,7 @@ Returns an indication of the sign of a number for each element `x_i` of the inpu
959991

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

962-
- an array containing the evaluated result for each element in `x`. If `out` is `None`, the returned array must have the same data type as `x`.
994+
- an array containing the evaluated result for each element in `x`.
963995

964996
### <a name="sin" href="#sin">#</a> sin(x, /)
965997

0 commit comments

Comments
 (0)