]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ntp/libntp/fptoa.c
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ntp / libntp / fptoa.c
1 /*
2  * fptoa - return an asciized representation of an s_fp number
3  */
4 #include "ntp_fp.h"
5 #include "ntp_stdlib.h"
6
7 char *
8 fptoa(
9         s_fp fpv,
10         short ndec
11         )
12 {
13         u_fp plusfp;
14         int neg;
15
16         if (fpv < 0) {
17                 plusfp = (u_fp)(-fpv);
18                 neg = 1;
19         } else {
20                 plusfp = (u_fp)fpv;
21                 neg = 0;
22         }
23
24         return dofptoa(plusfp, neg, ndec, 0);
25 }