mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 13:00:06 +00:00
1f55ce483b
separators also if no non-zero digits found. * stdlib/Makefile (tests): Add tst-strtod3.
26 lines
438 B
C
26 lines
438 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
static int
|
|
do_test (void)
|
|
{
|
|
int status = 0;
|
|
const char s[] = "0x";
|
|
char *ep;
|
|
double r = strtod (s, &ep);
|
|
if (r != 0)
|
|
{
|
|
printf ("r = %g, expect 0\n", r);
|
|
status = 1;
|
|
}
|
|
if (ep != s + 1)
|
|
{
|
|
printf ("strtod parsed %ju characters, expected 1\n", ep - s);
|
|
status = 1;
|
|
}
|
|
return status;
|
|
}
|
|
|
|
#define TEST_FUNCTION do_test ()
|
|
#include "../test-skeleton.c"
|