aboutsummaryrefslogtreecommitdiff
path: root/sys/libc/atof.c
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/libc/atof.c
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/libc/atof.c')
-rw-r--r--sys/libc/atof.c24
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);
+}