Lines Matching refs:rest

60 //        * rest = (too_high - buffer * 10^kappa).f() * unit
70 uint64_t rest,
92 // . . . . rest
143 // Conceptually rest ~= too_high - buffer
146 ASSERT(rest <= unsafe_interval);
147 while (rest < small_distance && // Negated condition 1
148 unsafe_interval - rest >= ten_kappa && // Negated condition 2
149 (rest + ten_kappa < small_distance || // buffer{-1} > w_high
150 small_distance - rest >= rest + ten_kappa - small_distance)) {
152 rest += ten_kappa;
158 if (rest < big_distance &&
159 unsafe_interval - rest >= ten_kappa &&
160 (rest + ten_kappa < big_distance ||
161 big_distance - rest > rest + ten_kappa - big_distance)) {
169 // Conceptually we have: rest ~= too_high - buffer
170 return (2 * unit <= rest) && (rest <= unsafe_interval - 4 * unit);
180 // If 2*rest > ten_kappa then the buffer needs to be round up.
181 // rest can have an error of +/- 1 unit. This function accounts for the
185 // Precondition: rest < ten_kappa.
188 uint64_t rest,
192 ASSERT(rest < ten_kappa);
194 // will work correctly with any uint64 values of rest < ten_kappa and unit.
197 // a unit of 50 means that the real number lies within rest +/- 50. If
204 // If 2 * (rest + unit) <= 10^kappa we can safely round down.
205 if ((ten_kappa - rest > rest) && (ten_kappa - 2 * rest >= 2 * unit)) {
208 // If 2 * (rest - unit) >= 10^kappa, then we can safely round up.
209 if ((rest > unit) && (ten_kappa - (rest - unit) <= (rest - unit))) {
441 uint64_t rest =
443 // Invariant: too_high = buffer * 10^kappa + DiyFp(rest, one.e())
445 if (rest < unsafe_interval.f()) {
449 unsafe_interval.f(), rest,
556 uint64_t rest =
558 return RoundWeedCounted(buffer, *length, rest,