From: jesusc Date: Thu, 17 Nov 2005 02:20:16 +0000 (+0000) Subject: Temporary patch for bug 1358192: printf("%f"...) sets fraction to zero. X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=d2b25c93d84846e3acae7e8ba07ef4b493ae754c;p=fw%2Fsdcc Temporary patch for bug 1358192: printf("%f"...) sets fraction to zero. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3950 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index bea8052b..646cbb96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-16 Jesus Calvino-Fraga + + * device/lib/printf_large.c: Temporary patch for bug 1358192: + printf("%f"...) sets fraction to zero. + 2005-11-16 Raphael Neider * src/pic/pcode.c (LinkFlow): handle empty flows correctly, diff --git a/device/lib/printf_large.c b/device/lib/printf_large.c index e087f64d..e0a24ab7 100644 --- a/device/lib/printf_large.c +++ b/device/lib/printf_large.c @@ -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); }