[Python-checkins] r75716 - python/branches/py3k/Python/pystrtod.c

mark.dickinson python-checkins at python.org
Mon Oct 26 15:36:29 CET 2009


Author: mark.dickinson
Date: Mon Oct 26 15:36:29 2009
New Revision: 75716

Log:
Move some comments to more appropriate places

Modified:
   python/branches/py3k/Python/pystrtod.c

Modified: python/branches/py3k/Python/pystrtod.c
==============================================================================
--- python/branches/py3k/Python/pystrtod.c	(original)
+++ python/branches/py3k/Python/pystrtod.c	Mon Oct 26 15:36:29 2009
@@ -3,11 +3,8 @@
 #include <Python.h>
 #include <locale.h>
 
-/* _Py_parse_inf_or_nan: Attempt to parse a string of the form "nan", "inf" or
-   "infinity", with an optional leading sign of "+" or "-".  On success,
-   return the NaN or Infinity as a double and set *endptr to point just beyond
-   the successfully parsed portion of the string.  On failure, return -1.0 and
-   set *endptr to point to the start of the string. */
+/* Case-insensitive string match used for nan and inf detection; t should be
+   lower-case.  Returns 1 for a successful match, 0 otherwise. */
 
 static int
 case_insensitive_match(const char *s, const char *t)
@@ -19,6 +16,12 @@
 	return *t ? 0 : 1;
 }
 
+/* _Py_parse_inf_or_nan: Attempt to parse a string of the form "nan", "inf" or
+   "infinity", with an optional leading sign of "+" or "-".  On success,
+   return the NaN or Infinity as a double and set *endptr to point just beyond
+   the successfully parsed portion of the string.  On failure, return -1.0 and
+   set *endptr to point to the start of the string. */
+
 double
 _Py_parse_inf_or_nan(const char *p, char **endptr)
 {


More information about the Python-checkins mailing list