fix: correct sidereal_day magnitude and standardize digit separators in astronomy.h - #787
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/mpusz/mp-units/sessions/80776de1-96d9-40da-ab02-767a215efba3 Co-authored-by: mpusz <506260+mpusz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mpusz/mp-units/sessions/d6c3365e-2620-4422-87dd-11d537ebe76e Co-authored-by: mpusz <506260+mpusz@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
mpusz
April 10, 2026 10:55
View session
mpusz
approved these changes
Apr 10, 2026
mpusz
approved these changes
Apr 10, 2026
Updated static assertions for time and length units in astronomy tests.
mpusz
approved these changes
Apr 10, 2026
mpusz
approved these changes
Apr 10, 2026
mpusz
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sidereal_dayevaluated to ~861.6 s (~14 min) instead of the correct ~86164 s (~23h 56m 4s) due to a misplaced digit separator producing a numerator 100× too large relative to the denominator. Two other constants in the same file had non-standard digit groupings.Type of Change
🔗 Related Issues
Closes #786
📝 Changes Made
sidereal_day:mag_ratio<86'164'0905, 1'000'000>→mag_ratio<861'640'905, 10'000>(
86'164'0905is a 9-digit integer; dividing by 10⁶ yielded 861.6 s, not 86164 s)Julian_year:mag_ratio<365'25, 100>→mag_ratio<36'525, 100>(non-standard 2-digit terminal group obscured the actual integer value 36525)
tropical_year:mag_ratio<365'242189, 1'000'000>→mag_ratio<365'242'189, 1'000'000>(6-digit terminal group split into standard 3-digit groups)
All values are mathematically correct after the changes;
sidereal_daywas the only functional bug.🌟 Additional Context
Non-standard digit separator groupings (e.g.
365'25,365'242189) can silently misrepresent the scale of a literal at a glance — the same class of issue that caused thesidereal_daybug.✅ Checklist
(if this change affects user-facing features)
By submitting this pull request, I confirm that my contribution is made under the terms
of the project's MIT license.