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

Function _get_size

numpy/core/src/umath/ufunc_object.c:575–590  ·  view source on GitHub ↗

* Convert a string into a number */

Source from the content-addressed store, hash-verified

573 * Convert a string into a number
574 */
575static npy_intp
576_get_size(const char* str)
577{
578 char *stop;
579 npy_longlong size = NumPyOS_strtoll(str, &stop, 10);
580
581 if (stop == str || _is_alpha_underscore(*stop)) {
582 /* not a well formed number */
583 return -1;
584 }
585 if (size >= NPY_MAX_INTP || size <= NPY_MIN_INTP) {
586 /* len(str) too long */
587 return -1;
588 }
589 return size;
590}
591
592/*
593 * Return the ending position of a variable name including optional modifier

Callers 1

_parse_signatureFunction · 0.85

Calls 2

NumPyOS_strtollFunction · 0.85
_is_alpha_underscoreFunction · 0.85

Tested by

no test coverage detected