summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/fptoms.c
diff options
context:
space:
mode:
authorroberto <roberto@FreeBSD.org>1999-12-09 13:01:21 +0000
committerroberto <roberto@FreeBSD.org>1999-12-09 13:01:21 +0000
commitef64b99e8412f2273dd2e8b3291c2f78ffc4667f (patch)
treefc0cfa1aab0ff6b228f511b410733ef4f35d1ead /contrib/ntp/libntp/fptoms.c
downloadFreeBSD-src-ef64b99e8412f2273dd2e8b3291c2f78ffc4667f.zip
FreeBSD-src-ef64b99e8412f2273dd2e8b3291c2f78ffc4667f.tar.gz
Virgin import of ntpd 4.0.98f
Diffstat (limited to 'contrib/ntp/libntp/fptoms.c')
-rw-r--r--contrib/ntp/libntp/fptoms.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/ntp/libntp/fptoms.c b/contrib/ntp/libntp/fptoms.c
new file mode 100644
index 0000000..4d371aa
--- /dev/null
+++ b/contrib/ntp/libntp/fptoms.c
@@ -0,0 +1,24 @@
+/*
+ * fptoms - return an asciized s_fp number in milliseconds
+ */
+#include "ntp_fp.h"
+
+char *
+fptoms(
+ 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, 1);
+}
OpenPOWER on IntegriCloud