Back to index

glibc  2.9
tst-atof1.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include <string.h>
00004 
00005 static int
00006 do_test (void)
00007 {
00008   char buf[100];
00009   snprintf (buf, sizeof (buf), "%g", atof ("0x10p-1"));
00010   if (strcmp (buf, "8") != 0)
00011     {
00012       printf ("got \"%s\", expected \"8\"\n", buf);
00013       return 1;
00014     }
00015   return 0;
00016 }
00017 
00018 #define TEST_FUNCTION do_test ()
00019 #include "../test-skeleton.c"