summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-07-01 07:07:10 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-07-01 07:07:10 +0000
commit9f69bfcd158873090facfba9e60ebb6d5dbb98f1 (patch)
tree271864259f927a47b327616f69fbfa76e8be0979
parent41366bcbdfdfbb653cd8bdac3c59512ecfaf5316 (diff)
downloadnumpy-9f69bfcd158873090facfba9e60ebb6d5dbb98f1.tar.gz
Add sqrt(2) and 1/sqrt(2) math constants in npymath.
-rw-r--r--numpy/core/include/numpy/npy_math.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/include/numpy/npy_math.h b/numpy/core/include/numpy/npy_math.h
index 41dba1269..52d72c9c8 100644
--- a/numpy/core/include/numpy/npy_math.h
+++ b/numpy/core/include/numpy/npy_math.h
@@ -63,6 +63,8 @@ NPY_INLINE static float __npy_nzerof(void)
#define NPY_1_PI 0.3183098861837906715377675267450287 /* 1/pi */
#define NPY_2_PI 0.6366197723675813430755350534900574 /* 2/pi */
#define NPY_EULER 0.5772156649015328606065120900824024 /* Euler constant */
+#define NPY_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */
+#define NPY_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */
#define NPY_Ef 2.7182818284590452353602874713526625F /* e */
#define NPY_LOG2Ef 1.4426950408889634073599246810018921F /* log_2 e */
@@ -75,6 +77,8 @@ NPY_INLINE static float __npy_nzerof(void)
#define NPY_1_PIf 0.3183098861837906715377675267450287F /* 1/pi */
#define NPY_2_PIf 0.6366197723675813430755350534900574F /* 2/pi */
#define NPY_EULERf 0.5772156649015328606065120900824024F /* Euler constant */
+#define NPY_SQRT2f 1.41421356237309504880168872420969808F /* sqrt(2) */
+#define NPY_SQRT1_2f 0.707106781186547524400844362104849039F /* 1/sqrt(2) */
#define NPY_El 2.7182818284590452353602874713526625L /* e */
#define NPY_LOG2El 1.4426950408889634073599246810018921L /* log_2 e */
@@ -87,6 +91,8 @@ NPY_INLINE static float __npy_nzerof(void)
#define NPY_1_PIl 0.3183098861837906715377675267450287L /* 1/pi */
#define NPY_2_PIl 0.6366197723675813430755350534900574L /* 2/pi */
#define NPY_EULERl 0.5772156649015328606065120900824024L /* Euler constant */
+#define NPY_SQRT2l 1.41421356237309504880168872420969808L /* sqrt(2) */
+#define NPY_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */
/*
* C99 double math funcs