diff options
-rw-r--r-- | doc/source/reference/c-api.coremath.rst | 4 | ||||
-rw-r--r-- | numpy/core/include/numpy/npy_math.h | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/doc/source/reference/c-api.coremath.rst b/doc/source/reference/c-api.coremath.rst index 8e6011603..b9939b96b 100644 --- a/doc/source/reference/c-api.coremath.rst +++ b/doc/source/reference/c-api.coremath.rst @@ -114,3 +114,7 @@ precision are also available by adding the F and L suffixes respectively. .. cvar:: NPY_2_PI Two times the reciprocal of pi (:math:`\frac{2}{\pi}`) + +.. cvar:: NPY_EULER + + The Euler constant (:math:`\lim_{n\rightarrow \infty}{\sum_{k=1}^n{\frac{1}{k}} - \ln n}`) diff --git a/numpy/core/include/numpy/npy_math.h b/numpy/core/include/numpy/npy_math.h index 2a8ea182b..4e2f444b8 100644 --- a/numpy/core/include/numpy/npy_math.h +++ b/numpy/core/include/numpy/npy_math.h @@ -62,6 +62,7 @@ NPY_INLINE static float __npy_nzerof(void) #define NPY_PI_4 0.7853981633974483096156608458198757 /* pi/4 */ #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_Ef 2.7182818284590452353602874713526625F /* e */ #define NPY_LOG2Ef 1.4426950408889634073599246810018921F /* log_2 e */ @@ -73,6 +74,7 @@ NPY_INLINE static float __npy_nzerof(void) #define NPY_PI_4f 0.7853981633974483096156608458198757F /* pi/4 */ #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_El 2.7182818284590452353602874713526625L /* e */ #define NPY_LOG2El 1.4426950408889634073599246810018921L /* log_2 e */ @@ -84,6 +86,7 @@ NPY_INLINE static float __npy_nzerof(void) #define NPY_PI_4l 0.7853981633974483096156608458198757L /* pi/4 */ #define NPY_1_PIl 0.3183098861837906715377675267450287L /* 1/pi */ #define NPY_2_PIl 0.6366197723675813430755350534900574L /* 2/pi */ +#define NPY_EULERf 0.5772156649015328606065120900824024L /* Euler constant */ /* * C99 double math funcs |