56 g_xfmt(buf, V, ndig, bufsize)
char* buf;
61 g_xfmt(
char *buf,
void *V,
int ndig,
unsigned bufsize)
64 static FPI fpi = {64, 1 - 16383 - 64 + 1, 32766 - 16383 - 64 + 1, 1, 0};
68 int decpt, ex, i, mode;
76 if(bufsize < (
unsigned)ndig + 10)
84 sign = L[_0] & 0x8000;
85 bits[1] = (
ULong)(L[_1] << 16) | L[_2];
86 bits[0] = (
ULong)(L[_3] << 16) | L[_4];
87 if((ex = L[_0] & 0x7fff) != 0)
95 b =
strcp(buf,
"NaN");
107 b =
strcp(b,
"Infinity");
113 else if(bits[0] | bits[1])
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 * gdtoa(FPI *fpi, int be, ULong *bits, int *kindp, int mode, int ndigits, int *decpt, char **rve)
char * g_xfmt(char *buf, void *V, int ndig, unsigned bufsize)