stdio-fp.c 392 B

12345678910111213141516171819202122232425262728
  1. /* This program is to generate one of the examples in stdio.texi. */
  2. #include <stdio.h>
  3. static void
  4. print (double v)
  5. {
  6. printf ("|%13.4a|%13.4f|%13.4e|%13.4g|\n", v, v, v, v);
  7. }
  8. int
  9. main (void)
  10. {
  11. print (0.0);
  12. print (0.5);
  13. print (1.0);
  14. print (-1.0);
  15. print (100.0);
  16. print (1000.0);
  17. print (10000.0);
  18. print (12345.0);
  19. print (100000.0);
  20. print (123456.0);
  21. return 0;
  22. }