Skip to content
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
39 changes: 0 additions & 39 deletions spec/API_specification/constants.md

This file was deleted.

24 changes: 24 additions & 0 deletions spec/API_specification/constants.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Constants
=========

Array API specification for constants.

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

- Each constant must have a Python floating-point data type (i.e., ``float``) and be provided as a Python scalar value.

Objects in API
--------------

.. currentmodule:: signatures.constants

..
NOTE: please keep the functions in alphabetical order

.. autosummary::
:toctree: generated

e
inf
nan
pi
25 changes: 25 additions & 0 deletions spec/API_specification/signatures/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
e = 2.718281828459045
"""
IEEE 754 floating-point representation of Euler's constant.

``e = 2.71828182845904523536028747135266249775724709369995...``
"""

inf = float('inf')
"""
IEEE 754 floating-point representation of (positive) infinity.
"""

nan = float('nan')
"""
IEEE 754 floating-point representation of Not a Number (``NaN``).
"""

pi = 3.141592653589793
"""
IEEE 754 floating-point representation of the mathematical constant ``π``.

``pi = 3.1415926535897932384626433...``
"""

__all__ = ['e', 'inf', 'nan', 'pi']