[Numpy-svn] r3638 - trunk/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Sun Apr 1 18:06:06 CDT 2007


Author: oliphant
Date: 2007-04-01 18:06:02 -0500 (Sun, 01 Apr 2007)
New Revision: 3638

Modified:
   trunk/numpy/core/src/scalarmathmodule.c.src
Log:
Fix ticket #463 wherein hex and oct did not work for values that could not be converted to an integer.

Modified: trunk/numpy/core/src/scalarmathmodule.c.src
===================================================================
--- trunk/numpy/core/src/scalarmathmodule.c.src	2007-04-01 21:01:12 UTC (rev 3637)
+++ trunk/numpy/core/src/scalarmathmodule.c.src	2007-04-01 23:06:02 UTC (rev 3638)
@@ -815,14 +815,16 @@
 /**begin repeat
    #name=(byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble,cfloat,cdouble,clongdouble)*2#
    #oper=oct*16, hex*16#
+   #kind=(int*5, long*5, int, long*2, int, long*2)*2#
+   #cap=(Int*5, Long*5, Int, Long*2, Int, Long*2)*2#
 **/
 static PyObject *
 @name@_@oper@(PyObject *obj)
 {
     PyObject *pyint;
-    pyint = @name@_int(obj);
+    pyint = @name@_@kind@(obj);
     if (pyint == NULL) return NULL;
-    return PyInt_Type.tp_as_number->nb_@oper@(pyint);
+    return Py@cap@_Type.tp_as_number->nb_@oper@(pyint);
 }
 /**end repeat**/
 



More information about the Numpy-svn mailing list