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

Function npy_to_double

numpy/core/src/multiarray/textreading/conversions.c:135–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133
134
135NPY_NO_EXPORT int
136npy_to_double(PyArray_Descr *descr,
137 const Py_UCS4 *str, const Py_UCS4 *end, char *dataptr,
138 parser_config *NPY_UNUSED(pconfig))
139{
140 double val;
141 const Py_UCS4 *p_end;
142 if (double_from_ucs4(str, end, true, &val, &p_end) < 0) {
143 return -1;
144 }
145 if (p_end != end) {
146 return -1;
147 }
148
149 memcpy(dataptr, &val, sizeof(double));
150 if (!PyArray_ISNBO(descr->byteorder)) {
151 npy_bswap8_unaligned(dataptr);
152 }
153 return 0;
154}
155
156
157static bool

Callers 1

str_to_int.cFile · 0.85

Calls 2

double_from_ucs4Function · 0.85
npy_bswap8_unalignedFunction · 0.85

Tested by

no test coverage detected