2014-06-01 11:57:22 +00:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "../util.h"
|
|
|
|
|
|
|
|
double
|
|
|
|
estrtod(const char *s)
|
|
|
|
{
|
|
|
|
char *end;
|
|
|
|
double d;
|
|
|
|
|
|
|
|
d = strtod(s, &end);
|
2014-11-13 18:54:28 +00:00
|
|
|
if (end == s || *end != '\0')
|
2014-06-01 11:57:22 +00:00
|
|
|
eprintf("%s: not a real number\n", s);
|
|
|
|
return d;
|
|
|
|
}
|