test more floating point data formats in printf

This commit is contained in:
gdr 1997-12-21 20:15:27 +00:00
parent b998993162
commit 07177f48d1

View File

@ -3,6 +3,10 @@
int main(void) {
double pi = 3.141596;
printf("pi is %f\n", pi);
printf("(f) pi is %f\n", pi);
printf("(e) pi is %e\n", pi);
printf("(g) pi is %g\n", pi);
printf("(.2g) pi is %.2g\n", pi);
printf("(.2g) pi is %.2g\n", pi / 1024. );
return 0;
}