cpython/Python/strtod.c

16 lines
285 B
C
Raw Normal View History

1991-04-16 17:45:40 +09:00
/* This is not a proper strtod() implementation, but sufficient for Python.
Python won't detect floating point constant overflow, though. */
1991-12-24 21:29:10 +08:00
extern int strlen();
1991-04-16 17:45:40 +09:00
extern double atof();
double
strtod(p, pp)
char *p;
char **pp;
{
if (pp)
1991-12-24 21:29:10 +08:00
*pp = p + strlen(p);
1991-04-16 17:45:40 +09:00
return atof(p);
}