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

Function NumPyOS_ascii_ftolf

numpy/core/src/common/numpyos.c:741–755  ·  view source on GitHub ↗

* NumPyOS_ascii_ftolf: * * fp: FILE pointer * * value: Place to store the value read * * Similar to PyOS_ascii_strtod, except that it reads input from a file. * * Similarly to fscanf, this function always consumes leading whitespace, * and any text that could be the leading part in valid input. * * Return value: similar to fscanf. * * 0 if no number read, * * 1 if a

Source from the content-addressed store, hash-verified

739 * * EOF if end-of-file met before reading anything.
740 */
741NPY_NO_EXPORT int
742NumPyOS_ascii_ftolf(FILE *fp, double *value)
743{
744 char buffer[FLOAT_FORMATBUFLEN + 1];
745 char *p;
746 int r;
747
748 r = read_numberlike_string(fp, buffer, FLOAT_FORMATBUFLEN+1);
749
750 if (r != EOF && r != 0) {
751 *value = NumPyOS_ascii_strtod(buffer, &p);
752 r = (p == buffer) ? 0 : 1;
753 }
754 return r;
755}
756
757NPY_NO_EXPORT int
758NumPyOS_ascii_ftoLf(FILE *fp, long double *value)

Callers

nothing calls this directly

Calls 2

read_numberlike_stringFunction · 0.85
NumPyOS_ascii_strtodFunction · 0.85

Tested by

no test coverage detected