mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 08:52:46 +00:00
26 lines
320 B
C
26 lines
320 B
C
/*
|
|
* 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);
|
|
}
|