Home | History | Annotate | Download | only in src

Lines Matching refs:unit

35 //        * distance_too_high_w == (too_high - w).f() * unit
36 // * unsafe_interval == (too_high - too_low).f() * unit
37 // * rest = (too_high - buffer * 10^kappa).f() * unit
38 // * ten_kappa = 10^kappa * unit
39 // * unit = the common multiplier
49 uint64_t unit) {
50 uint64_t small_distance = distance_too_high_w - unit;
51 uint64_t big_distance = distance_too_high_w + unit;
56 // The real w (* unit) must lie somewhere inside the interval
63 // ^v 1 unit ^ ^ ^ ^
65 // ^v 1 unit . . . .
73 // ^v 1 unit . . . .
75 // ^v 1 unit v . . .
83 // ^v 1 unit .
85 // ^v 1 unit v
93 // and v (the input number). They are guaranteed to be precise up to one unit.
94 // In fact the error is guaranteed to be strictly less than one unit.
147 return (2 * unit <= rest) && (rest <= unsafe_interval - 4 * unit);
158 // rest can have an error of +/- 1 unit. This function accounts for the
167 uint64_t unit,
171 // will work correctly with any uint64 values of rest < ten_kappa and unit.
173 // If the unit is too big, then we don't know which way to round. For example
174 // a unit of 50 means that the real number lies within rest +/- 50. If
176 if (unit >= ten_kappa) return false;
177 // Even if unit is just half the size of 10^kappa we are already completely
180 if (ten_kappa - unit <= unit) return false;
181 // If 2 * (rest + unit) <= 10^kappa we can safely round down.
182 if ((ten_kappa - rest > rest) && (ten_kappa - 2 * rest >= 2 * unit)) {
185 // If 2 * (rest - unit) >= 10^kappa, then we can safely round up.
186 if ((rest > unit) && (ten_kappa - (rest - unit) <= (rest - unit))) {
329 // * low, w and high are correct up to 1 ulp (unit in the last place). That
330 // is, their error must be less than a unit of their last digits.
371 // low, w and high are imprecise, but by less than one ulp (unit in the last
382 uint64_t unit = 1;
383 DiyFp too_low = DiyFp(low.f() - unit, low.e());
384 DiyFp too_high = DiyFp(high.f() + unit, high.e());
427 static_cast<uint64_t>(divisor) << -one.e(), unit);
435 // data (like the interval or 'unit'), too.
443 unit *= 10;
452 return RoundWeed(buffer, *length, DiyFp::Minus(too_high, w).f() * unit,
453 unsafe_interval.f(), fractionals, one.f(), unit);
469 // * w is correct up to 1 ulp (unit in the last place). That
470 // is, its error must be strictly less than a unit of its last digit.
496 // w is assumed to have an error less than 1 unit. Whenever w is scaled we
543 // data (the 'unit'), too.
609 // In fact: scaled_w - w*10^k < 1ulp (unit in the last place) of scaled_w.
668 // In fact: scaled_w - w*10^k < 1ulp (unit in the last place) of scaled_w.