]> git.gag.com Git - fw/sdcc/commitdiff
Temporary patch for bug 1358192: printf("%f"...) sets fraction to zero.
authorjesusc <jesusc@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 17 Nov 2005 02:20:16 +0000 (02:20 +0000)
committerjesusc <jesusc@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 17 Nov 2005 02:20:16 +0000 (02:20 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3950 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/lib/printf_large.c

index bea8052b27ee66b3fa05a88a17aa835b599e02a8..646cbb969b481698ce9f503525eb74294e2887eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-16 Jesus Calvino-Fraga <jesusc AT ece.ubc.ca>
+
+       * device/lib/printf_large.c: Temporary patch for bug 1358192: 
+         printf("%f"...) sets fraction to zero. 
+
 2005-11-16 Raphael Neider <rneider AT web.de>
 
        * src/pic/pcode.c (LinkFlow): handle empty flows correctly,
index e087f64d95f3873336d00b01c3ddda5fda90ba5d..e0a24ab7eea50816de9b7d10d6217f0eaee76e66 100644 (file)
@@ -211,7 +211,7 @@ static int output_float (float f, unsigned char reqWidth,
 
   // split the float
   integerPart=f;
-  decimalPart=f-integerPart;
+  decimalPart=f-(float)integerPart;
 
   // fill the buffer with the integerPart (in reversed order!)
   while (integerPart) {
@@ -235,7 +235,7 @@ static int output_float (float f, unsigned char reqWidth,
       // truncate the float
       integerPart=decimalPart;
       fpBuffer[fpBD++]='0' + integerPart;
-      decimalPart-=integerPart;
+      decimalPart-=(float)integerPart;
     } while (--i);
   }