Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5912b3a2b3e0
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9f49ba46d050
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Dec 30, 2020

  1. Fix 2 Pi.

    pleroy committed Dec 30, 2020
    Copy the full SHA
    6e89593 View commit details
  2. Merge pull request #2833 from pleroy/TwoPi

    Fix a bug in reduction mod 2π
    pleroy authored Dec 30, 2020
    Copy the full SHA
    9f49ba4 View commit details
Showing with 2 additions and 2 deletions.
  1. +2 −2 numerics/double_precision_body.hpp
4 changes: 2 additions & 2 deletions numerics/double_precision_body.hpp
Original file line number Diff line number Diff line change
@@ -207,8 +207,8 @@ DoublePrecision<Difference<T, U>> TwoDifference(T const& a, U const& b) {

inline DoublePrecision<Angle> Mod2π(DoublePrecision<Angle> const& θ) {
static DoublePrecision<Angle> const two_π = []() {
return QuickTwoSum(0x1.921FB54442D18p1 * Radian,
0x1.1A62633145C07p-53 * Radian);
return QuickTwoSum(0x1.921FB54442D18p2 * Radian,
0x1.1A62633145C07p-52 * Radian);
}();
auto const θ_over_2π = θ / two_π;
return θ - two_π * DoublePrecision<double>(static_cast<int>(θ_over_2π.value));