summaryrefslogtreecommitdiff
path: root/doc/source/reference
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-03-11 09:23:08 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-03-11 09:23:08 +0000
commit7bf8aced1804a1520820822a4f4e7c9faba6e29e (patch)
treefe4947fa6faf6cd59409fa5d03215f34c35889e6 /doc/source/reference
parentd71bd3549fef4ff4e4974c9334e140bc125e28cb (diff)
downloadnumpy-7bf8aced1804a1520820822a4f4e7c9faba6e29e.tar.gz
Document math constants.
Diffstat (limited to 'doc/source/reference')
-rw-r--r--doc/source/reference/c-api.coremath.rst45
-rw-r--r--doc/source/reference/c-api.rst1
2 files changed, 46 insertions, 0 deletions
diff --git a/doc/source/reference/c-api.coremath.rst b/doc/source/reference/c-api.coremath.rst
index b0bc5916a..71ee5ab11 100644
--- a/doc/source/reference/c-api.coremath.rst
+++ b/doc/source/reference/c-api.coremath.rst
@@ -67,3 +67,48 @@ Floating point classification
and extended precision, and return a non 0 value is x has the signbit set
(that is the number is negative).
+Useful math constants
+~~~~~~~~~~~~~~~~~~~~~
+
+The following math constants are available in npy_math.h. Single and extended
+precision are also available by adding the F and L suffixes respectively.
+
+.. cvar:: NPY_E
+
+ Euler constant (:math:`e^1`)
+
+.. cvar:: NPY_LOG2E
+
+ Logarithm to base 2 of the Euler constant (:math:`\frac{\ln(e^1)}{\ln(2)})
+
+.. cvar:: NPY_LOG10E
+
+ Logarithm to base 10 of the Euler constant (:math:`\frac{\ln(e^1)}{\ln(10)})
+
+.. cvar:: NPY_LOGE2
+
+ Natural logarithm of 2 (:math:`\ln(2)`)
+
+.. cvar:: NPY_LOGE10
+
+ Natural logarithm of 10 (:math:`\ln(10)`)
+
+.. cvar:: NPY_PI
+
+ Pi (:math:`\pi`)
+
+.. cvar:: NPY_PI_2
+
+ Pi divided by 2 (:math:`\frac{\pi}{2}`)
+
+.. cvar:: NPY_PI_4
+
+ Pi divided by 4 (:math:`\frac{\pi}{4}`)
+
+.. cvar:: NPY_1_PI
+
+ Reciprocal of pi (:math:`\frac{1}{\pi}`)
+
+.. cvar:: NPY_2_PI
+
+ Two times the reciprocal of pi (:math:`\frac{2}{\pi}`)
diff --git a/doc/source/reference/c-api.rst b/doc/source/reference/c-api.rst
index 27420a58c..a6ab83e0c 100644
--- a/doc/source/reference/c-api.rst
+++ b/doc/source/reference/c-api.rst
@@ -45,3 +45,4 @@ code.
c-api.dtype
c-api.array
c-api.ufunc
+ c-api.coremath