diff options
Diffstat (limited to 'doc/source/reference/c-api.ufunc.rst')
-rw-r--r-- | doc/source/reference/c-api.ufunc.rst | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/doc/source/reference/c-api.ufunc.rst b/doc/source/reference/c-api.ufunc.rst index 02a35cf56..8c2554a9e 100644 --- a/doc/source/reference/c-api.ufunc.rst +++ b/doc/source/reference/c-api.ufunc.rst @@ -94,19 +94,16 @@ Functions :param types: Length ``(nin + nout) * ntypes`` array of ``char`` encoding the - :ref:`PyArray_Descr.type_num` (built-in only) that the corresponding + `numpy.dtype.num` (built-in only) that the corresponding function in the ``func`` array accepts. For instance, for a comparison ufunc with three ``ntypes``, two ``nin`` and one ``nout``, where the - first function accepts :ref:`npy_int32` and the the second - :ref:`npy_int64`, with both returning :ref:`npy_bool`, ``types`` would + first function accepts `numpy.int32` and the the second + `numpy.int64`, with both returning `numpy.bool_`, ``types`` would be ``(char[]) {5, 5, 0, 7, 7, 0}`` since ``NPY_INT32`` is 5, - ``NPY_INT64`` is 7, and ``NPY_BOOL`` is 0 (on the python side, these - are exposed via :ref:`dtype.num`, i.e., for the example here, - ``dtype(np.int32).num``, ``dtype(np.int64).num``, and - ``dtype(np.bool_).num``, resp.). + ``NPY_INT64`` is 7, and ``NPY_BOOL`` is 0. - :ref:`casting-rules` will be used at runtime to find the first - ``func`` callable by the input/output provided. + :ref:`ufuncs.casting` will be used at runtime to find the first + ``func`` callable by the input/output provided. :param ntypes: How many different data-type-specific functions the ufunc has implemented. @@ -121,8 +118,9 @@ Functions The name for the ufunc. Specifying a name of 'add' or 'multiply' enables a special behavior for integer-typed reductions when no dtype is given. If the input type is an - integer (or boolean) data type smaller than the size of the int_ - data type, it will be internally upcast to the int_ (or uint) + integer (or boolean) data type smaller than the size of the + `numpy.int_` data type, it will be internally upcast to the + `numpy.int_` (or `numpy.uint`) data type. :param doc: |