File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 33#include <Python.h>
44#include <locale.h>
55
6- /* _Py_parse_inf_or_nan: Attempt to parse a string of the form "nan", "inf" or
7- "infinity", with an optional leading sign of "+" or "-". On success,
8- return the NaN or Infinity as a double and set *endptr to point just beyond
9- the successfully parsed portion of the string. On failure, return -1.0 and
10- set *endptr to point to the start of the string. */
6+ /* Case-insensitive string match used for nan and inf detection; t should be
7+ lower-case. Returns 1 for a successful match, 0 otherwise. */
118
129static int
1310case_insensitive_match (const char * s , const char * t )
@@ -19,6 +16,12 @@ case_insensitive_match(const char *s, const char *t)
1916 return * t ? 0 : 1 ;
2017}
2118
19+ /* _Py_parse_inf_or_nan: Attempt to parse a string of the form "nan", "inf" or
20+ "infinity", with an optional leading sign of "+" or "-". On success,
21+ return the NaN or Infinity as a double and set *endptr to point just beyond
22+ the successfully parsed portion of the string. On failure, return -1.0 and
23+ set *endptr to point to the start of the string. */
24+
2225double
2326_Py_parse_inf_or_nan (const char * p , char * * endptr )
2427{
You can’t perform that action at this time.
0 commit comments