diff options
author | David Cournapeau <cournape@gmail.com> | 2009-03-09 07:56:24 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-03-09 07:56:24 +0000 |
commit | 969ef155b0f5bae5520597e1ba6c30c05018d0bd (patch) | |
tree | c96f111fac2c110d9117565463dffb6d9fe5195c /numpy/core/src/scalarmathmodule.c.src | |
parent | 3b2ea6cc6a45171f5a8e188bd28766a8a28f0586 (diff) | |
download | numpy-969ef155b0f5bae5520597e1ba6c30c05018d0bd.tar.gz |
Make the type cast clearer + comment.
Diffstat (limited to 'numpy/core/src/scalarmathmodule.c.src')
-rw-r--r-- | numpy/core/src/scalarmathmodule.c.src | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index 0b4156b14..be626d2af 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -963,9 +963,9 @@ static int * #Name=Byte,UByte,Short,UShort,Int,UInt,Long,ULong,LongLong,ULongLong,Float,Double,LongDouble,CFloat,CDouble,CLongDouble# * #cmplx=,,,,,,,,,,,,,.real,.real,.real# * #sign=(signed,unsigned)*5,,,,,,# + * #unsigntyp=0,1,0,1,0,1,0,1,0,1,1*6# * #ctype=long*8,PY_LONG_LONG*2,double*6# * #realtyp=0*10,1*6# - * #unsigntyp=0,1,0,1,0,1,0,1,0,1,1*6# * #func=(PyLong_FromLong,PyLong_FromUnsignedLong)*4,PyLong_FromLongLong,PyLong_FromUnsignedLongLong,PyLong_FromDouble*6# */ static PyObject * @@ -978,6 +978,10 @@ static PyObject * x = ix; #endif +/* + * For unsigned type, the (@ctype@) cast just does what is implicitely done by + * the compiler. + */ #if @unsigntyp@ if(LONG_MIN < (@ctype@)x && (@ctype@)x < LONG_MAX) return PyInt_FromLong(x); |