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

Function _normalize_byteorder

numpy/core/src/multiarray/hashdescr.c:39–52  ·  view source on GitHub ↗

* normalize endian character: always return 'I', '<' or '>' */

Source from the content-addressed store, hash-verified

37 * normalize endian character: always return 'I', '<' or '>'
38 */
39static char _normalize_byteorder(char byteorder)
40{
41 switch(byteorder) {
42 case '=':
43 if (PyArray_GetEndianness() == NPY_CPU_BIG) {
44 return '>';
45 }
46 else {
47 return '<';
48 }
49 default:
50 return byteorder;
51 }
52}
53
54/*
55 * Return true if descr is a builtin type

Callers 1

_array_descr_builtinFunction · 0.85

Calls 1

PyArray_GetEndiannessFunction · 0.85

Tested by

no test coverage detected