7 #define NBSP "\xc2\xa0"
25 { "-0e-10", 0, -0.0 },
27 { "-0,e-10", 0, -0.0 },
28 { "0,0e-10", 0, 0.0 },
29 { "-0,0e-10", 0, -0.0 },
30 { "0e-1000000", 0, 0.0 },
31 { "-0e-1000000", 0, -0.0 },
32 { "0,0e-1000000", 0, 0.0 },
33 { "-0,0e-1000000", 0, -0.0 },
39 { "-0e-10", 1, -0.0 },
40 { "0e-1000000", 1, 0.0 },
41 { "-0e-1000000", 1, -0.0 },
42 { "000"NBSP
"000"NBSP
"000", 1, 0.0 },
43 { "-000"NBSP
"000"NBSP
"000", 1, -0.0 }
45 #define NTESTS (sizeof (tests) / sizeof (tests[0]))
51 if (setlocale (LC_ALL
, "cs_CZ.UTF-8") == NULL
)
53 puts ("could not set locale");
59 for (int i
= 0; i
< NTESTS
; ++i
)
65 r
= __strtod_internal (tests
[i
].in
, &ep
, 1);
67 r
= strtod (tests
[i
].in
, &ep
);
71 printf ("%d: got rest string \"%s\", expected \"\"\n", i
, ep
);
75 if (r
!= tests
[i
].expected
76 || copysign (10.0, r
) != copysign (10.0, tests
[i
].expected
))
78 printf ("%d: got wrong results %g, expected %g\n",
79 i
, r
, tests
[i
].expected
);
87 #define TEST_FUNCTION do_test ()
88 #include "../test-skeleton.c"