diff options
Diffstat (limited to 'sys/libc/atof.c')
-rw-r--r-- | sys/libc/atof.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/libc/atof.c b/sys/libc/atof.c new file mode 100644 index 00000000..df0ec7d9 --- /dev/null +++ b/sys/libc/atof.c @@ -0,0 +1,24 @@ +/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. +*/ + +#define import_spp +#define import_libc +#define import_xnames +#define import_ctype +#include <iraf.h> + + +/* ATOF -- Ascii to double floating. Convert any legal floating point number +** into a binary double precision floating value. +*/ +double +atof (char *str) +{ + XINT ip = 1; + XDOUBLE dval; + + if (CTOD (c_sppstr(str), &ip, &dval) == 0) + return ( (double) 0); + else + return ( (double) dval); +} |