Guido van Rossum | 753e2bf | 1991-04-16 08:45:40 +0000 | [diff] [blame] | 1 | /* This is not a proper strtod() implementation, but sufficient for Python. |
| 2 | Python won't detect floating point constant overflow, though. */ |
| 3 | |
Guido van Rossum | 54a41d6 | 1991-12-24 13:29:10 +0000 | [diff] [blame] | 4 | extern int strlen(); |
Guido van Rossum | 753e2bf | 1991-04-16 08:45:40 +0000 | [diff] [blame] | 5 | extern double atof(); |
| 6 | |
Guido van Rossum | 753e2bf | 1991-04-16 08:45:40 +0000 | [diff] [blame] | 7 | double |
| 8 | strtod(p, pp) |
| 9 | char *p; |
| 10 | char **pp; |
| 11 | { |
| 12 | if (pp) |
Guido van Rossum | 54a41d6 | 1991-12-24 13:29:10 +0000 | [diff] [blame] | 13 | *pp = p + strlen(p); |
Guido van Rossum | 753e2bf | 1991-04-16 08:45:40 +0000 | [diff] [blame] | 14 | return atof(p); |
| 15 | } |