Lines Matching full:bits
87 static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int pok)
98 int emax = -emin-bits+3;
164 if (lrp==dc && dc<10 && (bits>30 || x[0]>>bits==0))
191 int bitlim = bits-3*(int)(rp-9);
214 /* Upscale until desired number of bits are left of radix point */
241 /* Downscale until exactly number of bits are left of radix point */
275 /* Assemble desired bits into floating point variable */
284 if (bits > LDBL_MANT_DIG+e2-emin) {
285 bits = LDBL_MANT_DIG+e2-emin;
286 if (bits<0) bits=0;
290 /* Calculate bias term to force rounding, move out lower bits */
291 if (bits < LDBL_MANT_DIG) {
292 bias = copysignl(scalbn(1, 2*LDBL_MANT_DIG-bits-1), y);
293 frac = fmodl(y, scalbn(1, LDBL_MANT_DIG-bits));
311 if (LDBL_MANT_DIG-bits >= 2 && !fmodl(frac, 1))
320 if (denormal && bits==LDBL_MANT_DIG+e2-emin)
332 static long double hexfloat(FILE *f, int bits, int emin, int sign, int pok)
426 if (bits > 32+e2-emin) {
427 bits = 32+e2-emin;
428 if (bits<0) bits=0;
431 if (bits < LDBL_MANT_DIG)
432 bias = copysignl(scalbn(1, 32+LDBL_MANT_DIG-bits-1), sign);
434 if (bits<32 && y && !(x&1)) x++, y=0;
448 int bits;
454 bits = FLT_MANT_DIG;
455 emin = FLT_MIN_EXP-bits;
458 bits = DBL_MANT_DIG;
459 emin = DBL_MIN_EXP-bits;
462 bits = LDBL_MANT_DIG;
463 emin = LDBL_MIN_EXP-bits;
519 return hexfloat(f, bits, emin, sign, pok);
524 return decfloat(f, c, bits, emin, sign, pok);