numpy  2.0.0
src/umath/loops.c.src File Reference
#include "Python.h"
#include "npy_config.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "numpy/npy_math.h"
#include "numpy/halffloat.h"
#include "npy_pycompat.h"
#include "ufunc_object.h"

Defines

#define _UMATHMODULE
#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define IS_BINARY_REDUCE
#define OUTPUT_LOOP
#define UNARY_LOOP
#define UNARY_LOOP_TWO_OUT
#define BINARY_LOOP
#define BINARY_REDUCE_LOOP_INNER
#define BINARY_REDUCE_LOOP(TYPE)
#define BINARY_LOOP_TWO_OUT
#define TYPE   @_floor_divide @TYPE@_divide
#define TYPE   @_fmax @TYPE@_maximum
#define TYPE   @_fmin @TYPE@_minimum
#define TYPE   @_true_divide @TYPE@_divide
#define _HALF_LOGICAL_AND(a, b)   (!npy_half_iszero(a) && !npy_half_iszero(b))
#define _HALF_LOGICAL_OR(a, b)   (!npy_half_iszero(a) || !npy_half_iszero(b))
#define HALF_true_divide   HALF_divide
#define CGE(xr, xi, yr, yi)
#define CLE(xr, xi, yr, yi)
#define CGT(xr, xi, yr, yi)
#define CLT(xr, xi, yr, yi)
#define CEQ(xr, xi, yr, yi)   (xr == yr && xi == yi)
#define CNE(xr, xi, yr, yi)   (xr != yr || xi != yi)
#define TYPE   @_true_divide @TYPE@_divide

Typedefs

typedef float halfUnaryFunc (npy_half x)
typedef float floatUnaryFunc (float x)
typedef double doubleUnaryFunc (double x)
typedef npy_longdouble longdoubleUnaryFunc (npy_longdouble x)
typedef npy_half halfBinaryFunc (npy_half x, npy_half y)
typedef float floatBinaryFunc (float x, float y)
typedef double doubleBinaryFunc (double x, double y)
typedef npy_longdouble longdoubleBinaryFunc (npy_longdouble x, npy_longdouble y)
typedef void cdoubleUnaryFunc (npy_cdouble *x, npy_cdouble *r)
typedef void cfloatUnaryFunc (npy_cfloat *x, npy_cfloat *r)
typedef void clongdoubleUnaryFunc (npy_clongdouble *x, npy_clongdouble *r)
typedef void cdoubleBinaryFunc (npy_cdouble *x, npy_cdouble *y, npy_cdouble *r)
typedef void cfloatBinaryFunc (npy_cfloat *x, npy_cfloat *y, npy_cfloat *r)
typedef void clongdoubleBinaryFunc (npy_clongdouble *x, npy_clongdouble *y, npy_clongdouble *r)

Functions

NPY_NO_EXPORT void PyUFunc_e_e (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_e_e_As_f_f (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_e_e_As_d_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_f_f (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_f_f_As_d_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_ee_e (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_ee_e_As_ff_f (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_ee_e_As_dd_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_ff_f (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_ff_f_As_dd_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_d_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_dd_d (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_g_g (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_gg_g (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_F_F (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_F_F_As_D_D (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_FF_F (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_FF_F_As_DD_D (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_D_D (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_DD_D (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_G_G (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_GG_G (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_O_O (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_O_O_method (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_OO_O (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_OO_O_method (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void PyUFunc_On_Om (char **args, npy_intp *dimensions, npy_intp *steps, void *func)
NPY_NO_EXPORT void BOOL_ kind (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void BOOL_logical_xor (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void BOOL__ones_like (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void TYPE __ones_like (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void TYPE _square (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void TYPE _reciprocal (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void TYPE _conjugate (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _negative (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _logical_not (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _invert (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _logical_xor (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _true_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _power (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _fmod (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _absolute (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _sign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _remainder (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_negative (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_absolute (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_sign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void DATETIME_Mm_M_add (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void DATETIME_mM_M_add (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_mm_m_add (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void DATETIME_Mm_M_subtract (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void DATETIME_MM_m_subtract (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_mm_m_subtract (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_mq_m_multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_qm_m_multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_md_m_multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_dm_m_multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_mq_m_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_md_m_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TIMEDELTA_mm_d_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _spacing (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _copysign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _nextafter (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _floor_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _modf (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_logical_xor (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_logical_not (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_spacing (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_copysign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_nextafter (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_floor_divide (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_remainder (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_square (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void HALF_reciprocal (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void HALF__ones_like (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
NPY_NO_EXPORT void HALF_conjugate (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_absolute (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_negative (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_sign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void HALF_modf (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE _multiply (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void TYPE __arg (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
NPY_NO_EXPORT void OBJECT_sign (char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))

Define Documentation

#define _HALF_LOGICAL_AND (   a,
 
)    (!npy_half_iszero(a) && !npy_half_iszero(b))
end repeat*
#define _HALF_LOGICAL_OR (   a,
 
)    (!npy_half_iszero(a) || !npy_half_iszero(b))
#define _UMATHMODULE
#define BINARY_LOOP
Value:
char *ip1 = args[0], *ip2 = args[1], *op1 = args[2];\
    npy_intp is1 = steps[0], is2 = steps[1], os1 = steps[2];\
    npy_intp n = dimensions[0];\
    npy_intp i;\
    for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op1 += os1)

Referenced by _nextafter(), _reciprocal(), _true_divide(), DATETIME_mM_M_add(), HALF_copysign(), PyUFunc_ee_e_As_dd_d(), PyUFunc_ee_e_As_ff_f(), PyUFunc_FF_F_As_DD_D(), TIMEDELTA_dm_m_multiply(), and TIMEDELTA_negative().

Value:
char *ip1 = args[0], *ip2 = args[1], *op1 = args[2], *op2 = args[3];\
    npy_intp is1 = steps[0], is2 = steps[1], os1 = steps[2], os2 = steps[3];\
    npy_intp n = dimensions[0];\
    npy_intp i;\
    for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op1 += os1, op2 += os2)
#define BINARY_REDUCE_LOOP (   TYPE)
Value:
char *iop1 = args[0]; \
    TYPE io1 = *(TYPE *)iop1; \
    BINARY_REDUCE_LOOP_INNER

Referenced by _square(), and DATETIME_mM_M_add().

Value:
char *ip2 = args[1]; \
    npy_intp is2 = steps[1]; \
    npy_intp n = dimensions[0]; \
    npy_intp i; \
    for(i = 0; i < n; i++, ip2 += is2)

Referenced by _copysign().

#define CEQ (   xr,
  xi,
  yr,
  yi 
)    (xr == yr && xi == yi)
#define CGE (   xr,
  xi,
  yr,
  yi 
)
Value:
((xr > yr && !npy_isnan(xi) && !npy_isnan(yi)) \
                          || (xr == yr && xi >= yi))

* COMPLEX LOOPS **

#define CGT (   xr,
  xi,
  yr,
  yi 
)
Value:
((xr > yr && !npy_isnan(xi) && !npy_isnan(yi)) \
                          || (xr == yr && xi > yi))
#define CLE (   xr,
  xi,
  yr,
  yi 
)
Value:
((xr < yr && !npy_isnan(xi) && !npy_isnan(yi)) \
                          || (xr == yr && xi <= yi))
#define CLT (   xr,
  xi,
  yr,
  yi 
)
Value:
((xr < yr && !npy_isnan(xi) && !npy_isnan(yi)) \
                          || (xr == yr && xi < yi))
#define CNE (   xr,
  xi,
  yr,
  yi 
)    (xr != yr || xi != yi)
Value:
((args[0] == args[2])\
        && (steps[0] == steps[2])\
        && (steps[0] == 0))

* UFUNC LOOPS **

Referenced by _copysign(), _square(), and DATETIME_mM_M_add().

#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define OUTPUT_LOOP
Value:
char *op1 = args[1];\
    npy_intp os1 = steps[1];\
    npy_intp n = dimensions[0];\
    npy_intp i;\
    for(i = 0; i < n; i++, op1 += os1)
#define TYPE   @_floor_divide @TYPE@_divide

* INTEGER LOOPS

begin repeat
TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG#
#type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
npy_double, npy_double, npy_double, npy_double#
end repeat1*

Referenced by suff().

#define TYPE   @_fmax @TYPE@_maximum

* INTEGER LOOPS

begin repeat
TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG#
#type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
npy_double, npy_double, npy_double, npy_double#
end repeat1*
#define TYPE   @_fmin @TYPE@_minimum

* INTEGER LOOPS

begin repeat
TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG#
#type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
npy_double, npy_double, npy_double, npy_double#
end repeat1*
#define TYPE   @_true_divide @TYPE@_divide

* INTEGER LOOPS

begin repeat
TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG#
#type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
npy_double, npy_double, npy_double, npy_double#
end repeat1*
#define TYPE   @_true_divide @TYPE@_divide

* INTEGER LOOPS

begin repeat
TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG#
#type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
npy_long, npy_ulong, npy_longlong, npy_ulonglong#
#ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
npy_double, npy_double, npy_double, npy_double#
end repeat1*
#define UNARY_LOOP
Value:
char *ip1 = args[0], *op1 = args[1];\
    npy_intp is1 = steps[0], os1 = steps[1];\
    npy_intp n = dimensions[0];\
    npy_intp i;\
    for(i = 0; i < n; i++, ip1 += is1, op1 += os1)

Referenced by _absolute(), _fmod(), _logical_xor(), BOOL_logical_xor(), HALF_floor_divide(), HALF_remainder(), HALF_sign(), PyUFunc_D_D(), PyUFunc_DD_D(), PyUFunc_e_e(), PyUFunc_e_e_As_f_f(), PyUFunc_gg_g(), and TIMEDELTA_mm_m_subtract().

Value:
char *ip1 = args[0], *op1 = args[1], *op2 = args[2];\
    npy_intp is1 = steps[0], os1 = steps[1], os2 = steps[2];\
    npy_intp n = dimensions[0];\
    npy_intp i;\
    for(i = 0; i < n; i++, ip1 += is1, op1 += os1, op2 += os2)

Typedef Documentation

System Message: SEVERE/4 (<string>, line 1)
Title overline & underline mismatch.

                          GENERIC COMPLEX LOOPS                           **
 
typedef void cfloatUnaryFunc(npy_cfloat *x, npy_cfloat *r)
typedef double doubleBinaryFunc(double x, double y)
typedef double doubleUnaryFunc(double x)
typedef float floatBinaryFunc(float x, float y)
typedef float floatUnaryFunc(float x)
typedef float halfUnaryFunc(npy_half x)
System Message: SEVERE/4 (<string>, line 1)
Title overline & underline mismatch.

                          GENERIC FLOAT LOOPS                             **
 

Function Documentation

NPY_NO_EXPORT void TYPE __arg ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE __ones_like ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
begin repeat
#type = npy_datetime, npy_timedelta# TYPE = DATETIME, TIMEDELTA#
begin repeat
TYPE = DATETIME, TIMEDELTA#
NPY_NO_EXPORT void C TYPE _absolute ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*
begin repeat
TYPE = BYTE, SHORT, INT, LONG, LONGLONG# #type = npy_byte, npy_short, npy_int, npy_long, npy_longlong#
end repeat*
begin repeat
TYPE = UBYTE, USHORT, UINT, ULONG, ULONGLONG# #type = npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong#
add 0 to clear -0.0

References UNARY_LOOP.

NPY_NO_EXPORT void C TYPE _conjugate ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _copysign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void C TYPE _divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
FIXME: On x86 at least, dividing the smallest representable integer by -1 causes a SIFGPE (division overflow). We treat this case here (to avoid a SIGFPE crash at python level), but a good solution would be to treat integer division problems separately from FPU exceptions (i.e. a different approach than npy_set_floatstatus_divbyzero()).
divide by zero should yield a complex inf or nan
NPY_NO_EXPORT void C TYPE _floor_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*
NPY_NO_EXPORT void TYPE _fmod ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References NPY_DATETIME_NAT, and UNARY_LOOP.

Referenced by _ctype_power().

NPY_NO_EXPORT void TYPE _invert ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void C TYPE _logical_not ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void C TYPE _logical_xor ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*

References UNARY_LOOP.

NPY_NO_EXPORT void TYPE _modf ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _multiply ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*
NPY_NO_EXPORT void TYPE _negative ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _nextafter ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TYPE _power ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void C TYPE _reciprocal ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)

References BINARY_LOOP.

NPY_NO_EXPORT void TYPE _remainder ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
handle mixed case the way Python does

References NPY_DATETIME_NAT.

NPY_NO_EXPORT void C TYPE _sign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Sign of nan is nan
fixme: sign of nan is currently 0
NPY_NO_EXPORT void TYPE _spacing ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*
NPY_NO_EXPORT void C TYPE _square ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
end repeat1*

References BINARY_REDUCE_LOOP, and IS_BINARY_REDUCE.

NPY_NO_EXPORT void TYPE _true_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat1*

References BINARY_LOOP, and npy_set_floatstatus_divbyzero().

NPY_NO_EXPORT void BOOL__ones_like ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
end repeat*
NPY_NO_EXPORT void BOOL_logical_xor ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*

References UNARY_LOOP.

NPY_NO_EXPORT void DATETIME_Mm_M_add ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
end repeat1*
end repeat*

References NPY_NAN.

NPY_NO_EXPORT void DATETIME_mM_M_add ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void DATETIME_Mm_M_subtract ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void DATETIME_MM_m_subtract ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF__ones_like ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
NPY_NO_EXPORT void HALF_absolute ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_conjugate ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_copysign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References BINARY_LOOP, c, and npy_fabs().

NPY_NO_EXPORT void HALF_floor_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*

References UNARY_LOOP.

NPY_NO_EXPORT void HALF_logical_not ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_logical_xor ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*
NPY_NO_EXPORT void HALF_modf ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_negative ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_nextafter ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void HALF_reciprocal ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
NPY_NO_EXPORT void HALF_remainder ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References UNARY_LOOP.

NPY_NO_EXPORT void HALF_sign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Sign of nan is nan

References c, npy_hypot(), and UNARY_LOOP.

NPY_NO_EXPORT void HALF_spacing ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*
NPY_NO_EXPORT void HALF_square ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDdata 
)
NPY_NO_EXPORT void OBJECT_ kind ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

* BOOLEAN LOOPS **

begin repeat
kind = equal, not_equal, greater, greater_equal, less, less_equal# #OP = ==, !=, >, >=, <, <=#
end repeat*
begin repeat
kind = logical_and, logical_or# #OP = &&, ||# #SC = ==, !=#
begin repeat
kind = maximum, minimum# #OP = >, <#
end repeat*
begin repeat
kind = absolute, logical_not# #OP = !=, ==#
begin repeat1

Arithmetic kind = add, subtract, multiply, bitwise_and, bitwise_or, bitwise_xor,

System Message: ERROR/3 (<string>, line 4) Unexpected indentation.

<blockquote> left_shift, right_shift#</blockquote>

System Message: WARNING/2 (<string>, line 5) Block quote ends without a blank line; unexpected unindent.

#OP = +, -,*, &, |, ^, <<, >>#

System Message: WARNING/2 (<string>, line 5); backlink Inline substitution_reference start-string without end-string.
end repeat1*
begin repeat1
kind = equal, not_equal, greater, greater_equal, less, less_equal,
logical_and, logical_or#
System Message: WARNING/2 (<string>, line 4) Definition list ends without a blank line; unexpected unindent.

#OP = ==, !=, >, >=, <, <=, &&, ||#

begin repeat1
kind = maximum, minimum# #OP = >, <#
begin repeat1
kind = equal, not_equal, greater, greater_equal, less, less_equal# #OP = ==, !=, >, >=, <, <=#
end repeat1*
begin repeat1
kind = maximum, minimum# #OP = >, <#

* FLOAT LOOPS **

begin repeat
Float types
#type = npy_float, npy_double, npy_longdouble# TYPE = FLOAT, DOUBLE, LONGDOUBLE# c = f, , l# C = F, , L#
begin repeat1

Arithmetic # kind = add, subtract, multiply, divide# # OP = +, -, *, /#

System Message: WARNING/2 (<string>, line 2); backlink Inline emphasis start-string without end-string.
end repeat1*
begin repeat1
kind = equal, not_equal, less, less_equal, greater, greater_equal,
logical_and, logical_or#
System Message: WARNING/2 (<string>, line 4) Definition list ends without a blank line; unexpected unindent.

#OP = ==, !=, <, <=, >, >=, &&, ||#

begin repeat1
kind = isnan, isinf, isfinite, signbit# #func = npy_isnan, npy_isinf, npy_isfinite, npy_signbit#
begin repeat1
kind = maximum, minimum# #OP = >=, <=#
end repeat1*
begin repeat1
kind = fmax, fmin# #OP = >=, <=#
end repeat*

* HALF-FLOAT LOOPS **

begin repeat

Arithmetic # kind = add, subtract, multiply, divide# # OP = +, -, *, /#

System Message: WARNING/2 (<string>, line 2); backlink Inline emphasis start-string without end-string.
begin repeat
kind = equal, not_equal, less, less_equal, greater,
greater_equal, logical_and, logical_or#
#OP = npy_half_eq, npy_half_ne, npy_half_lt, npy_half_le, npy_half_gt,
npy_half_ge, _HALF_LOGICAL_AND, _HALF_LOGICAL_OR#
begin repeat
kind = isnan, isinf, isfinite, signbit# #func = npy_half_isnan, npy_half_isinf, npy_half_isfinite, npy_half_signbit#
begin repeat
kind = maximum, minimum# #OP = npy_half_ge, npy_half_le#
end repeat*
begin repeat
kind = fmax, fmin# #OP = npy_half_ge, npy_half_le#
begin repeat
complex types TYPE = CFLOAT, CDOUBLE, CLONGDOUBLE# #ftype = npy_float, npy_double, npy_longdouble# c = f, , l# C = F, , L#
begin repeat1
arithmetic kind = add, subtract# #OP = +, -#
begin repeat1
kind= greater, greater_equal, less, less_equal, equal, not_equal# #OP = CGT, CGE, CLT, CLE, CEQ, CNE#
end repeat1*
begin repeat1
kind = logical_and, logical_or# #OP1 = ||, ||# #OP2 = &&, ||#
begin repeat1
kind = isnan, isinf, isfinite# #func = npy_isnan, npy_isinf, npy_isfinite# #OP = ||, ||, &&#
begin repeat1
kind = maximum, minimum# #OP = CGE, CLE#
end repeat1*
begin repeat1
kind = fmax, fmin# #OP = CGE, CLE#
end repeat*

* OBJECT LOOPS **

begin repeat
kind = equal, not_equal, greater, greater_equal, less, less_equal# #OP = EQ, NE, GT, GE, LT, LE#
end repeat*
begin repeat
kind = maximum, minimum# #OP = >, <#
begin repeat2

Arithmetic kind = add, subtract, multiply, bitwise_and, bitwise_or, bitwise_xor,

System Message: ERROR/3 (<string>, line 4) Unexpected indentation.

<blockquote> left_shift, right_shift#</blockquote>

System Message: WARNING/2 (<string>, line 5) Block quote ends without a blank line; unexpected unindent.

#OP = +, -,*, &, |, ^, <<, >>#

System Message: WARNING/2 (<string>, line 5); backlink Inline substitution_reference start-string without end-string.
end repeat2*
begin repeat2
kind = equal, not_equal, greater, greater_equal, less, less_equal,
logical_and, logical_or#
System Message: WARNING/2 (<string>, line 4) Definition list ends without a blank line; unexpected unindent.

#OP = ==, !=, >, >=, <, <=, &&, ||#

begin repeat2
kind = maximum, minimum# #OP = >, <#
end repeat*

* FLOAT LOOPS **

begin repeat
Float types
TYPE = HALF, FLOAT, DOUBLE, LONGDOUBLE# c = f, f, , l# C = F, F, , L#
begin repeat1

Arithmetic # kind = add, subtract, multiply, divide# # OP = +, -, *, /#

System Message: WARNING/2 (<string>, line 2); backlink Inline emphasis start-string without end-string.
begin repeat1
kind = isnan, isinf, isfinite, signbit, copysign, nextafter, spacing# #func = npy_isnan, npy_isinf, npy_isfinite, npy_signbit, npy_copysign, nextafter, spacing#
end repeat1*
begin repeat1
kind = maximum, minimum# #OP = >=, <=#
begin repeat
complex types TYPE = FLOAT, DOUBLE, LONGDOUBLE# c = f, , l# C = F, , L#
begin repeat1
arithmetic kind = add, subtract# #OP = +, -#

* OBJECT LOOPS **

begin repeat
kind = equal, not_equal, greater, greater_equal, less, less_equal# #OP = EQ, NE, GT, GE, LT, LE#
NPY_NO_EXPORT void OBJECT_sign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*
NPY_NO_EXPORT void PyUFunc_d_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_D_D ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References UNARY_LOOP.

NPY_NO_EXPORT void PyUFunc_dd_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_DD_D ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References UNARY_LOOP.

NPY_NO_EXPORT void PyUFunc_e_e ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_e_e_As_d_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_e_e_As_f_f ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_ee_e ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_ee_e_As_dd_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References BINARY_LOOP.

NPY_NO_EXPORT void PyUFunc_ee_e_As_ff_f ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References BINARY_LOOP.

NPY_NO_EXPORT void PyUFunc_f_f ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_F_F ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_f_f_As_d_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_F_F_As_D_D ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_ff_f ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_FF_F ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_ff_f_As_dd_d ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_FF_F_As_DD_D ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)

References BINARY_LOOP.

NPY_NO_EXPORT void PyUFunc_g_g ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_G_G ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_gg_g ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_GG_G ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_O_O ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
System Message: SEVERE/4 (<string>, line 1)
Title overline & underline mismatch.

                         GENERIC OBJECT lOOPS                             **
 

References PyUFunc_PyFuncData::callable, PyUFunc_PyFuncData::nin, PyUFunc_PyFuncData::nout, and NPY_MAXARGS.

NPY_NO_EXPORT void PyUFunc_O_O_method ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_On_Om ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
A general-purpose ufunc that deals with general-purpose Python callable. func is a structure with nin, nout, and a Python callable function
NPY_NO_EXPORT void PyUFunc_OO_O ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void PyUFunc_OO_O_method ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  func 
)
NPY_NO_EXPORT void TIMEDELTA_absolute ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TIMEDELTA_dm_m_multiply ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References BINARY_LOOP, and npy_isnan.

NPY_NO_EXPORT void TIMEDELTA_md_m_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TIMEDELTA_md_m_multiply ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TIMEDELTA_mm_d_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TIMEDELTA_mm_m_add ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
NPY_NO_EXPORT void TIMEDELTA_mm_m_subtract ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)

References UNARY_LOOP.

NPY_NO_EXPORT void TIMEDELTA_mq_m_divide ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Note: Assuming 'q' == NPY_LONGLONG

References npy_isnan.

NPY_NO_EXPORT void TIMEDELTA_mq_m_multiply ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Note: Assuming 'q' == NPY_LONGLONG
NPY_NO_EXPORT void TIMEDELTA_negative ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
end repeat*

* DATETIME LOOPS **

References BINARY_LOOP, and NPY_DATETIME_NAT.

NPY_NO_EXPORT void TIMEDELTA_qm_m_multiply ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)
Note: Assuming 'q' == NPY_LONGLONG
NPY_NO_EXPORT void TIMEDELTA_sign ( char **  args,
npy_intp dimensions,
npy_intp steps,
void *  NPY_UNUSEDfunc 
)