54 g_Qfmt(buf, V, ndig, bufsize)
char* buf;
59 g_Qfmt(
char *buf,
void *V,
int ndig,
unsigned bufsize)
62 static FPI fpi = {113, 1 - 16383 - 113 + 1, 32766 - 16383 - 113 + 1, 1, 0};
64 ULong bits[4], *L, sign;
65 int decpt, ex, i, mode;
73 if(bufsize < (
unsigned)ndig + 10)
81 sign = L[_0] & 0x80000000L;
82 bits[3] = L[_0] & 0xffff;
87 if((ex = (L[_0] & 0x7fff0000L) >> 16) != 0)
92 if(bits[0] | bits[1] | bits[2] | bits[3])
107 b =
strcp(b,
"Infinity");
114 else if(bits[0] | bits[1] | bits[2] | bits[3])
121 #ifndef IGNORE_ZERO_SIGN 145 s =
gdtoa(&fpi, ex, bits, &i, mode, ndig, &decpt, &se);
146 return g__fmt(buf, s, se, decpt, sign);
char * g__fmt(char *b, char *s, const char *se, int decpt, ULong sign)
char * g_Qfmt(char *buf, void *V, int ndig, unsigned bufsize)
char * gdtoa(FPI *fpi, int be, ULong *bits, int *kindp, int mode, int ndigits, int *decpt, char **rve)