aboutsummaryrefslogtreecommitdiff
path: root/contrib/ntp/libntp/fptoa.c
diff options
context:
space:
mode:
authorOllivier Robert <roberto@FreeBSD.org>1999-12-09 13:01:21 +0000
committerOllivier Robert <roberto@FreeBSD.org>1999-12-09 13:01:21 +0000
commitc0b746e5e8d9479f05b3749cbf1f73b8928719bd (patch)
treefc0cfa1aab0ff6b228f511b410733ef4f35d1ead /contrib/ntp/libntp/fptoa.c
Virgin import of ntpd 4.0.98fvendor/ntp/4.0.98f
Diffstat (limited to 'contrib/ntp/libntp/fptoa.c')
-rw-r--r--contrib/ntp/libntp/fptoa.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/contrib/ntp/libntp/fptoa.c b/contrib/ntp/libntp/fptoa.c
new file mode 100644
index 000000000000..f0247ddcdf86
--- /dev/null
+++ b/contrib/ntp/libntp/fptoa.c
@@ -0,0 +1,25 @@
+/*
+ * fptoa - return an asciized representation of an s_fp number
+ */
+#include "ntp_fp.h"
+#include "ntp_stdlib.h"
+
+char *
+fptoa(
+ s_fp fpv,
+ int ndec
+ )
+{
+ u_fp plusfp;
+ int neg;
+
+ if (fpv < 0) {
+ plusfp = (u_fp)(-fpv);
+ neg = 1;
+ } else {
+ plusfp = (u_fp)fpv;
+ neg = 0;
+ }
+
+ return dofptoa(plusfp, neg, ndec, 0);
+}