develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r36094 - trunk/src/string

From:
particle
Date:
January 28, 2009 06:42
Subject:
[svn:parrot] r36094 - trunk/src/string
Message ID:
20090128144146.9AF16CB9AE@x12.develooper.com
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))



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About