tst-atof1.c 349 B

12345678910111213141516171819
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. static int
  5. do_test (void)
  6. {
  7. char buf[100];
  8. snprintf (buf, sizeof (buf), "%g", atof ("0x10p-1"));
  9. if (strcmp (buf, "8") != 0)
  10. {
  11. printf ("got \"%s\", expected \"8\"\n", buf);
  12. return 1;
  13. }
  14. return 0;
  15. }
  16. #define TEST_FUNCTION do_test ()
  17. #include "../test-skeleton.c"