Lines Matching refs:rest

36 //        * rest = (too_high - buffer * 10^kappa).f() * unit
44 uint64_t rest, uint64_t ten_kappa, uint64_t unit) {
64 // . . . . rest
115 // Conceptually rest ~= too_high - buffer
118 DCHECK(rest <= unsafe_interval);
119 while (rest < small_distance && // Negated condition 1
120 unsafe_interval - rest >= ten_kappa && // Negated condition 2
121 (rest + ten_kappa < small_distance || // buffer{-1} > w_high
122 small_distance - rest >= rest + ten_kappa - small_distance)) {
124 rest += ten_kappa;
130 if (rest < big_distance && unsafe_interval - rest >= ten_kappa &&
131 (rest + ten_kappa < big_distance ||
132 big_distance - rest > rest + ten_kappa - big_distance)) {
140 // Conceptually we have: rest ~= too_high - buffer
141 return (2 * unit <= rest) && (rest <= unsafe_interval - 4 * unit);
150 // If 2*rest > ten_kappa then the buffer needs to be round up.
151 // rest can have an error of +/- 1 unit. This function accounts for the
155 // Precondition: rest < ten_kappa.
156 static bool RoundWeedCounted(Vector<char> buffer, int length, uint64_t rest,
158 DCHECK(rest < ten_kappa);
160 // will work correctly with any uint64 values of rest < ten_kappa and unit.
163 // a unit of 50 means that the real number lies within rest +/- 50. If
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))) {
409 uint64_t rest =
411 // Invariant: too_high = buffer * 10^kappa + DiyFp(rest, one.e())
413 if (rest < unsafe_interval.f()) {
417 unsafe_interval.f(), rest,
519 uint64_t rest =
521 return RoundWeedCounted(buffer, *length, rest,