Author: particle
Date: Wed Jan 28 06:41:45 2009
New Revision: 36094

Modified:
   trunk/src/string/api.c

Log:
[core] oops! strings refactor caused my changes to string_to_num not to be 
committed. i blame society.

Modified: trunk/src/string/api.c
==============================================================================
--- trunk/src/string/api.c      (original)
+++ trunk/src/string/api.c      Wed Jan 28 06:41:45 2009
@@ -2124,7 +2124,14 @@
     while (isspace((unsigned char)*p))
         p++;
 
-    f = atof(p);
+    if (STREQ(p, PARROT_CSTRING_INF_POSITIVE))
+        f = PARROT_FLOATVAL_INF_POSITIVE;
+    else if (STREQ(p, PARROT_CSTRING_INF_NEGATIVE))
+        f = PARROT_FLOATVAL_INF_NEGATIVE;
+    else if (STREQ(p, PARROT_CSTRING_NAN_QUIET))
+        f = PARROT_FLOATVAL_NAN_QUIET;
+    else
+        f = atof(p);
 
     /* Not all atof()s return -0 from "-0" */
     if (*p == '-' && FLOAT_IS_ZERO(f))

Reply via email to