Skip to content

Add specifications for constants and associated element-wise functions #41

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 5 commits into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
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
31 changes: 31 additions & 0 deletions spec/API_specification/constants.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Constants

> Array API specification for constants.

A conforming implementation of the array API standard must provide and support the following constants.

<!-- NOTE: please keep the constants in alphabetical order -->

### <a name="e" href="#e">#</a> e

Euler's constant.

```text
e = 2.71828182845904523536028747135266249775724709369995...
```

### <a name="inf" href="#inf">#</a> inf

IEEE 754 floating point representation of (positive) infinity.

### <a name="nan" href="#nan">#</a> nan

IEEE 754 floating point representation of Not a Number (`NaN`).

### <a name="pi" href="#pi">#</a> pi

The mathematical constant `π`.

```text
pi = 3.1415926535897932384626433...
```
48 changes: 48 additions & 0 deletions spec/API_specification/elementwise_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,54 @@ Computes the truth value of `x1_i >= x2_i` for each element `x1_i` of the input

- an array containing the element-wise results.

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

Tests each element `x_i` of the input array `x` to determine if finite (i.e., not `NaN` and not equal to positive or negative infinity).

#### Parameters

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

- input array.

#### Returns

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

- an array, whose underlying data type is `bool`, containing test results. An element `out_i` is `True` if `x_i` is finite and `False` otherwise.

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

Tests each element `x_i` of the input array `x` to determine if equal to positive or negative infinity.

#### Parameters

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

- input array.

#### Returns

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

- an array, whose underlying data type is `bool`, containing test results. An element `out_i` is `True` if `x_i` is either positive or negative infinity and `False` otherwise.

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

Tests each element `x_i` of the input array `x` to determine whether the element is `NaN`.

#### Parameters

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

- input array.

#### Returns

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

- an array, whose underlying data type is `bool`, containing test results. An element `out_i` is `True` if `x_i` is `NaN` and `False` otherwise.

### <a name="less" href="#less">#</a> less(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
1 change: 1 addition & 0 deletions spec/API_specification/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ API specification
linear_algebra_functions
searching_functions
set_functions
constants