4 #include "stdio_impl.h"
6 static long double strtox(const char *s, char **p, int prec)
9 .buf = (void *)s, .rpos = (void *)s,
10 .rend = (void *)-1, .lock = -1
13 long double y = __floatscan(&f, prec, 1);
14 off_t cnt = shcnt(&f);
15 if (p) *p = cnt ? (char *)s + cnt : (char *)s;
19 float strtof(const char *restrict s, char **restrict p)
21 return strtox(s, p, 0);
24 double strtod(const char *restrict s, char **restrict p)
26 return strtox(s, p, 1);
29 long double strtold(const char *restrict s, char **restrict p)
31 return strtox(s, p, 2);