diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/libc/atof.c | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
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); +} |