Skip to content

Commit

Permalink
Fix complex init in scalarmath
Browse files Browse the repository at this point in the history
  • Loading branch information
lysnikolaou committed Jul 7, 2023
1 parent 8437a56 commit c2fb01c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions numpy/core/src/umath/scalarmath.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -1625,13 +1625,31 @@ static PyObject *
* Byte, UByte, Short, UShort, Int, UInt,
* Long, ULong, LongLong, ULongLong#
*
* #ONAME = (BYTE, UBYTE, SHORT, USHORT, INT, UINT,
* LONG, ULONG, LONGLONG, ULONGLONG,
* HALF, FLOAT, DOUBLE, LONGDOUBLE,
* CFLOAT, CDOUBLE, CLONGDOUBLE)*2,
* BYTE, UBYTE, SHORT, USHORT, INT, UINT,
* LONG, ULONG, LONGLONG, ULONGLONG,
* HALF, FLOAT, DOUBLE, LONGDOUBLE,
* FLOAT, DOUBLE, LONGDOUBLE,
*
* BYTE, UBYTE, SHORT, USHORT, INT, UINT,
* LONG, ULONG, LONGLONG, ULONGLONG#
*
* #IS_COMPLEX = 0*14, 1*3, 0*14, 1*3, 0*27#
*
* #oper = negative*17, positive*17, absolute*17, invert*10#
*/
static PyObject *
@name@_@oper@(PyObject *a)
{
@type@ val;
#if @IS_COMPLEX@ == 1
@otype@ out = NPY_@ONAME@_INIT(0.0, 0.0);
#else
@otype@ out;
#endif
PyObject *ret;


Expand Down

0 comments on commit c2fb01c

Please sign in to comment.