36 g_ffmt(buf, f, ndig, bufsize)
char* buf;
41 g_ffmt(
char *buf,
float *f,
int ndig,
unsigned bufsize)
44 static FPI fpi = {24, 1 - 127 - 24 + 1, 254 - 127 - 24 + 1, 1, 0};
46 ULong bits[1], *L, sign;
47 int decpt, ex, i, mode;
53 if(bufsize < (
unsigned)(ndig + 10))
59 sign = L[0] & 0x80000000L;
60 if((L[0] & 0x7f800000) == 0x7f800000)
65 return strcp(buf,
"NaN");
74 return strcp(b,
"Infinity");
79 #ifndef IGNORE_ZERO_SIGN 80 if(L[0] & 0x80000000L)
91 bits[0] = L[0] & 0x7fffff;
92 if((ex = (L[0] >> 23) & 0xff) != 0)
115 s =
gdtoa(&fpi, ex, bits, &i, mode, ndig, &decpt, &se);
116 return g__fmt(buf, s, se, decpt, sign);
char * g__fmt(char *b, char *s, const char *se, int decpt, ULong sign)
char * gdtoa(FPI *fpi, int be, ULong *bits, int *kindp, int mode, int ndigits, int *decpt, char **rve)
char * g_ffmt(char *buf, float *f, int ndig, unsigned bufsize)