Lines Matching refs:fp
17 pub fn round<F, Cb>(fp: &mut ExtendedFloat, cb: Cb)
31 if -fp.exp >= mantissa_shift {
41 let shift = -fp.exp + 1;
43 cb(fp, shift.min(64));
45 fp.exp = (fp.mant >= F::HIDDEN_BIT_MASK) as i32;
50 cb(fp, mantissa_shift);
54 if fp.mant & carry_mask == carry_mask {
55 fp.mant >>= 1;
56 fp.exp += 1;
60 if fp.exp >= F::INFINITE_POWER {
62 *fp = fp_inf;
67 fp.mant &= F::MANTISSA_MASK;
77 pub fn round_nearest_tie_even<Cb>(fp: &mut ExtendedFloat, shift: i32, cb: Cb)
93 let truncated_bits = fp.mant & mask;
107 fp.mant = match shift == 64 {
109 false => fp.mant >> shift,
111 fp.exp += shift;
114 let is_odd = fp.mant & 1 == 1;
119 fp.mant += cb(is_odd, is_halfway, is_above) as u64;
124 pub fn round_down(fp: &mut ExtendedFloat, shift: i32) {
126 fp.mant = match shift == 64 {
128 false => fp.mant >> shift,
130 fp.exp += shift;