Subject: printf bug ?
To: None <port-pmax@NetBSD.ORG>
From: Manuel Bouyer <bouyer@ensta.fr>
List: port-pmax
Date: 02/18/1996 18:28:11
Hello,
i've compilled and installed -current (sup of 960213), and i get  strange
things with printf.
The following program:
#include <stdio.h>
main()
{
long a,b,c;
a=116938;
b=216394;
printf("  %f %d\n", (double)a/(double)b*100.0,4);
}

gives me:
#./a.out
  -25993471005282696953856.000000 1078658314
but if i remplace the printf line by:
printf("%d  %f %d\n",5, (double)a/(double)b*100.0,4);
i get:
#./a.out
5  54.039391 4
witch is the good result. Using an intermediate double variable to store
the result of (double)a/(double)b*100.0 does'nt change anything.
Did anyone else noticed this ? This breaks df. 
I use the gcc 2.7.2 from the source tree. Perhaps i should keep the
2.7.1 from 1.1 binaries ?

--
Manuel Bouyer, Ecole Nationale Superieure de Techniques Avancees, Paris
email: bouyer@ensta.fr
--