MCPcopy Create free account
hub / github.com/numpy/numpy / PyArray_GetEndianness

Function PyArray_GetEndianness

numpy/core/src/multiarray/multiarraymodule.c:3228–3245  ·  view source on GitHub ↗

NUMPY_API */

Source from the content-addressed store, hash-verified

3226/*NUMPY_API
3227*/
3228NPY_NO_EXPORT int
3229PyArray_GetEndianness(void)
3230{
3231 const union {
3232 npy_uint32 i;
3233 char c[4];
3234 } bint = {0x01020304};
3235
3236 if (bint.c[0] == 1) {
3237 return NPY_CPU_BIG;
3238 }
3239 else if (bint.c[0] == 4) {
3240 return NPY_CPU_LITTLE;
3241 }
3242 else {
3243 return NPY_CPU_UNKNOWN_ENDIAN;
3244 }
3245}
3246
3247static PyObject *
3248array__reconstruct(PyObject *NPY_UNUSED(dummy), PyObject *args)

Callers 1

_normalize_byteorderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected