Back to index

glibc  2.9
stdio-fp.c
Go to the documentation of this file.
00001 /* This program is to generate one of the examples in stdio.texi.  */
00002 
00003 #include <stdio.h>
00004 
00005 
00006 static void
00007 print (double v)
00008 {
00009   printf ("|%13.4a|%13.4f|%13.4e|%13.4g|\n", v, v, v, v);
00010 }
00011 
00012 
00013 int
00014 main (void)
00015 {
00016   print (0.0);
00017   print (0.5);
00018   print (1.0);
00019   print (-1.0);
00020   print (100.0);
00021   print (1000.0);
00022   print (10000.0);
00023   print (12345.0);
00024   print (100000.0);
00025   print (123456.0);
00026 
00027   return 0;
00028 }