Review feedback from @TimothyBanks and @gregtatcam

- Get rid of MantissaRange::getRanges() function. Rewrite
  getMantissaScale to use all constexpr values.
- In Number::Guard::round(), document the "intentional" shadowing of
  "mode", and simplify one of the checks. Add an assert.
This commit is contained in:
Ed Hennis
2026-06-17 21:39:21 -04:00
parent cebd4ecf15
commit 6504042b8d
2 changed files with 66 additions and 71 deletions

View File

@@ -158,7 +158,7 @@ struct MantissaRange final
rep const max{(min * 10) - 1};
CuspRoundingFix const cuspRoundingFix{isCuspFixEnabled(scale)};
static MantissaRange const&
static constexpr MantissaRange const&
getMantissaRange(MantissaScale scale);
static std::set<MantissaScale> const&
@@ -213,9 +213,6 @@ private:
throw std::runtime_error("Unknown mantissa scale"); // LCOV_EXCL_LINE
}
}
static std::unordered_map<MantissaScale, MantissaRange> const&
getRanges();
};
// Like std::integral, but only 64-bit integral types.