Lines Matching refs:unit

34 //        * distance_too_high_w == (too_high - w).f() * unit
35 // * unsafe_interval == (too_high - too_low).f() * unit
36 // * rest = (too_high - buffer * 10^kappa).f() * unit
37 // * ten_kappa = 10^kappa * unit
38 // * unit = the common multiplier
44 uint64_t rest, uint64_t ten_kappa, uint64_t unit) {
45 uint64_t small_distance = distance_too_high_w - unit;
46 uint64_t big_distance = distance_too_high_w + unit;
51 // The real w (* unit) must lie somewhere inside the interval
58 // ^v 1 unit ^ ^ ^ ^
60 // ^v 1 unit . . . .
68 // ^v 1 unit . . . .
70 // ^v 1 unit v . . .
78 // ^v 1 unit .
80 // ^v 1 unit v
88 // and v (the input number). They are guaranteed to be precise up to one unit.
89 // In fact the error is guaranteed to be strictly less than one unit.
141 return (2 * unit <= rest) && (rest <= unsafe_interval - 4 * unit);
151 // rest can have an error of +/- 1 unit. This function accounts for the
157 uint64_t ten_kappa, uint64_t unit, int* kappa) {
160 // will work correctly with any uint64 values of rest < ten_kappa and unit.
162 // If the unit is too big, then we don't know which way to round. For example
163 // a unit of 50 means that the real number lies within rest +/- 50. If
165 if (unit >= ten_kappa) return false;
166 // Even if unit is just half the size of 10^kappa we are already completely
169 if (ten_kappa - unit <= unit) return false;
170 // If 2 * (rest + unit) <= 10^kappa we can safely round down.
171 if ((ten_kappa - rest > rest) && (ten_kappa - 2 * rest >= 2 * unit)) {
174 // If 2 * (rest - unit) >= 10^kappa, then we can safely round up.
175 if ((rest > unit) && (ten_kappa - (rest - unit) <= (rest - unit))) {
324 // * low, w and high are correct up to 1 ulp (unit in the last place). That
325 // is, their error must be less than a unit of their last digits.
362 // low, w and high are imprecise, but by less than one ulp (unit in the last
373 uint64_t unit = 1;
374 DiyFp too_low = DiyFp(low.f() - unit, low.e());
375 DiyFp too_high = DiyFp(high.f() + unit, high.e());
418 static_cast<uint64_t>(divisor) << -one.e(), unit);
426 // data (like the interval or 'unit'), too.
434 unit *= 10;
443 return RoundWeed(buffer, *length, DiyFp::Minus(too_high, w).f() * unit,
444 unsafe_interval.f(), fractionals, one.f(), unit);
458 // * w is correct up to 1 ulp (unit in the last place). That
459 // is, its error must be strictly less than a unit of its last digit.
482 // w is assumed to have an error less than 1 unit. Whenever w is scaled we
529 // data (the 'unit'), too.
591 // In fact: scaled_w - w*10^k < 1ulp (unit in the last place) of scaled_w.
645 // In fact: scaled_w - w*10^k < 1ulp (unit in the last place) of scaled_w.