forked from Vhex-Kernel-Core/fxlibc
Lephenixnoir
f5cca84ae8
This uses a generic function strto_fp similar to strto_int that is used for strtol and its derivatives.
11 lines
215 B
C
11 lines
215 B
C
#include "stdlib_p.h"
|
|
#include <errno.h>
|
|
|
|
double strtod(char const * restrict ptr, char ** restrict endptr)
|
|
{
|
|
double d = 0;
|
|
int err = strto_fp(ptr, endptr, &d, NULL, NULL);
|
|
if(err != 0) errno = err;
|
|
return d;
|
|
}
|