]> granicus.if.org Git - php/commitdiff
MFH
authorIlia Alshanetsky <iliaa@php.net>
Mon, 5 May 2003 19:57:40 +0000 (19:57 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 5 May 2003 19:57:40 +0000 (19:57 +0000)
ext/standard/tests/serialize/001.phpt
ext/standard/tests/serialize/003.phpt
main/snprintf.c

index ab8ac99c53041d724b923325d4b929120835a972..811355beb79426436e548e8c52d26c201b3547c5 100644 (file)
@@ -79,13 +79,13 @@ i:0;
 i:-1;
 i:2147483647;
 i:-2147483647;
-d:1.123456789;
+d:1.123456789000000011213842299184761941432952880859375;
 d:1;
 d:0;
 d:-1;
-d:-1.123456789;
+d:-1.123456789000000011213842299184761941432952880859375;
 s:5:"hallo";
-a:6:{i:0;i:1;i:1;d:1.1;i:2;s:5:"hallo";i:3;N;i:4;b:1;i:5;a:0:{}}
+a:6:{i:0;i:1;i:1;d:1.100000000000000088817841970012523233890533447265625;i:2;s:5:"hallo";i:3;N;i:4;b:1;i:5;a:0:{}}
 O:1:"t":1:{s:1:"a";s:5:"hallo";}
 object(t)(1) {
   ["a"]=>
index 43e9077382e4cf2eddb03087d75f73475d1554c5..b4fbcc120009f6b2e1ed41d5d299b3680dbb168c 100644 (file)
@@ -17,8 +17,8 @@ float(100)
 d:5.2E+25;
 float(5.2E+25)
 
-d:8.529E-22;
+d:8.528999999999999914734871708787977695465087890625E-22;
 float(8.529E-22)
 
-d:9E-09;
+d:9.0000000000000017763568394002504646778106689453125E-9;
 float(9.E-9)
index 37c7e0849e25b6605ea24c4aebf7cbfa1d9ef044..9593f5909cc5316268449fc9cdad46778b294e98 100644 (file)
@@ -367,6 +367,10 @@ ap_php_gcvt(double number, int ndigit, char *buf, boolean_e altform)
        register int i;
        char buf1[NDIG];
 
+       if (ndigit >= NDIG - 1) {
+               ndigit = NDIG - 2;      
+       }
+
        p1 = ap_php_ecvt(number, ndigit, &decpt, &sign, buf1);
        p2 = buf;
        if (sign)