Still not seeing this in p6i, so resending.

-------- Original Message --------
Subject: [PATCH] Re: [perl #31046] IRIX64 perlnum_36 float output
expectation
Date: Sat, 14 Aug 2004 15:18:01 +0300
From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
References: <[EMAIL PROTECTED]>

Duh.  The best way to get -0.0 is ... -0.0.

With this patch IRIX64 passes t/pmc/perlnum.t, and therefore passes the
test suite 100%.






-- 
Jarkko Hietaniemi <[EMAIL PROTECTED]> http://www.iki.fi/jhi/ "There is this special
biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen
--- src/string.c.dist   Sat Aug 14 14:42:07 2004
+++ src/string.c        Sat Aug 14 15:14:57 2004
@@ -2533,9 +2533,14 @@
     if (s) {
         /*
          * XXX C99 atof interpreters 0x prefix
+         * XXX would strtod() be better for detecting malformed input?
          */
         char *cstr = string_to_cstring(interpreter, const_cast(s));
+        while (isspace(*cstr)) cstr++;
         f = atof(cstr);
+        /* Not all atof()s return -0 from "-0" */
+        if (*cstr == '-' && f == 0.0)
+            f = -0.0;
         string_cstring_free(cstr);
         return f;
     }

Reply via email to