Enum NPY_SCALARKIND
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
NumPy's NPY_SCALARKIND enum (numpy/_core/include/numpy/ndarraytypes.h, NumPy 2.4.2): the kind of a
scalar for the LEGACY value-based casting of NumPy 1.x, the answer of PyArray_ScalarKind that
PyArray_CanCoerceScalar reads. The same members, order and values as the header.
public enum NPY_SCALARKIND
Fields
NPY_NOSCALAR = -1Not a scalar (an array of one or more dimensions):
PyArray_CanCoerceScalarthen requires a safe cast.NPY_BOOL_SCALAR = 0A bool scalar.
NPY_INTPOS_SCALAR = 1A non-negative integer: every unsigned integer scalar, and a signed one whose sign bit is clear. It may be coerced to signed and unsigned integer types.
NPY_INTNEG_SCALAR = 2A negative signed integer, which may not be coerced to an unsigned integer type.
NPY_FLOAT_SCALAR = 3A floating-point scalar.
NPY_COMPLEX_SCALAR = 4A complex scalar.
NPY_OBJECT_SCALAR = 5An object scalar, also NumPy's default kind for every other builtin type: it coerces only by a safe cast.
Remarks
NumPy 2 keeps it in its C API for compatibility only: NEP 50 promotion never asks for a scalar's kind, and neither
does NumSharp, whose promotion is the NEP 50 tables (result_type(params DType[])). It is mirrored so
code ported from NumPy's C API compiles; nothing in NumSharp reads it. NumPy's NPY_NSCALARKINDS define is
NPY_OBJECT_SCALAR + 1.