[Numpy-svn] r6440 - in branches/coremath/numpy/core: include/numpy src

numpy-svn@scip... numpy-svn@scip...
Sat Feb 21 11:03:29 CST 2009


Author: cdavid
Date: 2009-02-21 11:03:06 -0600 (Sat, 21 Feb 2009)
New Revision: 6440

Modified:
   branches/coremath/numpy/core/include/numpy/npy_math.h
   branches/coremath/numpy/core/src/umath_funcs.inc.src
Log:
Move math constants out of umath into npymath.

Modified: branches/coremath/numpy/core/include/numpy/npy_math.h
===================================================================
--- branches/coremath/numpy/core/include/numpy/npy_math.h	2009-02-21 17:02:18 UTC (rev 6439)
+++ branches/coremath/numpy/core/include/numpy/npy_math.h	2009-02-21 17:03:06 UTC (rev 6440)
@@ -5,6 +5,42 @@
 #include <numpy/npy_common.h>
 
 /*
+ * Useful constants
+ */
+#define NPY_E        2.7182818284590452353602874713526625 /* e */
+#define NPY_LOG2E    1.4426950408889634073599246810018921 /* log_2 e */
+#define NPY_LOG10E   0.4342944819032518276511289189166051 /* log_10 e */
+#define NPY_LOGE2    0.6931471805599453094172321214581766 /* log_e 2 */
+#define NPY_LOGE10   2.3025850929940456840179914546843642 /* log_e 10 */
+#define NPY_PI       3.1415926535897932384626433832795029 /* pi */
+#define NPY_PI_2     1.5707963267948966192313216916397514 /* pi/2 */
+#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_Ef        2.7182818284590452353602874713526625F /* e */
+#define NPY_LOG2Ef    1.4426950408889634073599246810018921F /* log_2 e */
+#define NPY_LOG10Ef   0.4342944819032518276511289189166051F /* log_10 e */
+#define NPY_LOGE2f    0.6931471805599453094172321214581766F /* log_e 2 */
+#define NPY_LOGE10f   2.3025850929940456840179914546843642F /* log_e 10 */
+#define NPY_PIf       3.1415926535897932384626433832795029F /* pi */
+#define NPY_PI_2f     1.5707963267948966192313216916397514F /* pi/2 */
+#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_El        2.7182818284590452353602874713526625L /* e */
+#define NPY_LOG2El    1.4426950408889634073599246810018921L /* log_2 e */
+#define NPY_LOG10El   0.4342944819032518276511289189166051L /* log_10 e */
+#define NPY_LOGE2l    0.6931471805599453094172321214581766L /* log_e 2 */
+#define NPY_LOGE10l   2.3025850929940456840179914546843642L /* log_e 10 */
+#define NPY_PIl       3.1415926535897932384626433832795029L /* pi */
+#define NPY_PI_2l     1.5707963267948966192313216916397514L /* pi/2 */
+#define NPY_PI_4l     0.7853981633974483096156608458198757L /* pi/4 */
+#define NPY_1_PIl     0.3183098861837906715377675267450287L /* 1/pi */
+#define NPY_2_PIl     0.6366197723675813430755350534900574L /* 2/pi */
+
+/*
  * C99 double math funcs
  */
 double npy_sin(double x);

Modified: branches/coremath/numpy/core/src/umath_funcs.inc.src
===================================================================
--- branches/coremath/numpy/core/src/umath_funcs.inc.src	2009-02-21 17:02:18 UTC (rev 6439)
+++ branches/coremath/numpy/core/src/umath_funcs.inc.src	2009-02-21 17:03:06 UTC (rev 6440)
@@ -10,24 +10,6 @@
 
 #define M_LOG10_E       0.434294481903251827651128918916605082294397
 
-/* Useful constants in three precisions.*/
-
-/**begin repeat
- * #c = f, ,l#
- * #C = F, ,L#
- */
-#define NPY_E@c@        2.7182818284590452353602874713526625@C@ /* e */
-#define NPY_LOG2E@c@    1.4426950408889634073599246810018921@C@ /* log_2 e */
-#define NPY_LOG10E@c@   0.4342944819032518276511289189166051@C@ /* log_10 e */
-#define NPY_LOGE2@c@    0.6931471805599453094172321214581766@C@ /* log_e 2 */
-#define NPY_LOGE10@c@   2.3025850929940456840179914546843642@C@ /* log_e 10 */
-#define NPY_PI@c@       3.1415926535897932384626433832795029@C@ /* pi */
-#define NPY_PI_2@c@     1.5707963267948966192313216916397514@C@ /* pi/2 */
-#define NPY_PI_4@c@     0.7853981633974483096156608458198757@C@ /* pi/4 */
-#define NPY_1_PI@c@     0.3183098861837906715377675267450287@C@ /* 1/pi */
-#define NPY_2_PI@c@     0.6366197723675813430755350534900574@C@ /* 2/pi */
-/**end repeat**/
-
 /*
  *****************************************************************************
  **                        PYTHON OBJECT FUNCTIONS                          **



More information about the Numpy-svn mailing list