3 #include "stdio_impl.h"
5 static long double strtox(const char *s, char **p, int prec)
8 while (isspace(*t)) t++;
10 .buf = (void *)t, .rpos = (void *)t,
11 .rend = (void *)-1, .lock = -1
14 long double y = __floatscan(&f, -1, prec, 1, &cnt);
15 if (p) *p = cnt ? t + cnt : (char *)s;
19 float strtof(const char *s, char **p)
21 return strtox(s, p, 0);
24 double strtod(const char *s, char **p)
26 return strtox(s, p, 1);
29 long double strtold(const char *s, char **p)
31 return strtox(s, p, 2);