Skip to content

PR: Transform constants.md to rst format #347

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 2 commits into from
Jan 11, 2022
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']