Lines Matching defs:rounding

58     const Real &y, Rounding rounding) const {
90 return y.Add(*this, rounding);
96 return y.Add(*this, rounding);
99 // x + (-x) -> +0.0 unless rounding is directed downwards
100 if (rounding.mode == common::RoundingMode::Down) {
120 // the rounding bits.
132 result, isNegative, exponent, fraction, rounding, roundingBits);
138 const Real &y, Rounding rounding) const {
189 NormalizeAndRound(result, isNegative, exponent, product.upper, rounding,
198 const Real &y, Rounding rounding) const {
258 result, isNegative, exponent, quotient, rounding, roundingBits);
265 ValueWithRealFlags<Real<W, P>> Real<W, P>::SQRT(Rounding rounding) const {
295 result = scaled.SQRT(rounding);
307 // rounding.
324 Fraction::ConvertUnsigned(extFrac.SHIFTR(2)).value, rounding,
383 const Real &y, Rounding rounding) const {
393 auto yOverX{y.Divide(*this, rounding)}; // y/x
395 auto squared{yOverX.value.Multiply(yOverX.value, rounding)}; // (y/x)**2
399 auto sum{squared.value.Add(one, rounding)}; // 1.0 + (y/x)**2
403 result = sqrt.value.Multiply(ABS(), rounding);
418 const Real &p, Rounding rounding) const {
438 result.value.Subtract(adj, rounding).AccumulateFlags(result.flags);
455 const Real &p, Rounding rounding) const {
456 ValueWithRealFlags<Real> result{MOD(p, rounding)};
462 result.value.Add(p, rounding).AccumulateFlags(result.flags);
470 const Real &y, Rounding rounding) const {
476 result = Subtract(y, rounding);
511 const Fraction &fraction, Rounding rounding, RoundingBits *roundingBits) {
515 // No fraction, no rounding bits -> +/-0.0
529 if (rounding.mode == common::RoundingMode::TiesToEven ||
530 rounding.mode == common::RoundingMode::TiesAwayFromZero ||
531 (rounding.mode == common::RoundingMode::Up && !negative) ||
532 (rounding.mode == common::RoundingMode::Down && negative)) {
538 // directed rounding: round to largest finite value rather than infinity
577 Rounding rounding, const RoundingBits &bits, bool multiply) {
585 bits.MustRound(rounding, IsNegative(), word_.BTEST(0) /* is odd */)) {
590 // The fraction was all ones before rounding; sum.value is now zero
601 if (rounding.x86CompatibleBehavior && Exponent() != 0 && multiply &&
604 (rounding.mode != common::RoundingMode::Up &&
605 rounding.mode != common::RoundingMode::Down))) {
608 // the guard bit is set or we're not using directed rounding
618 bool isNegative, int exponent, const Fraction &fraction, Rounding rounding,
621 isNegative, exponent, fraction, rounding, &roundingBits);
622 result.flags |= result.value.Round(rounding, roundingBits, multiply);
626 common::RoundingMode rounding) {
627 switch (rounding) {
658 const char *&p, Rounding rounding) {
660 decimal::ConvertToBinary<P>(p, MapRoundingMode(rounding.mode))};