Skip to content

fix: correct sidereal_day magnitude and standardize digit separators in astronomy.h - #787

Merged
mpusz merged 8 commits into
masterfrom
copilot/check-bug-claim-constant
Apr 10, 2026
Merged

mpusz merged 8 commits into
masterfrom
copilot/check-bug-claim-constant

Conversation

Copilot AI commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

sidereal_day evaluated 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

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Build system / CI changes
  • 🧪 Test improvements
  • ♻️ Code refactoring
  • 🎨 Code style improvements

🔗 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'0905 is 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_day was 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 the sidereal_day bug.

✅ Checklist

  • I have read the Contributing Guidelines
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the project's documentation to cover the modified or new functionality
    (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.

@mpusz
mpusz marked this pull request as ready for review April 10, 2026 12:11
@mpusz
mpusz merged commit b76b903 into master Apr 10, 2026
147 of 148 checks passed
@mpusz
mpusz deleted the copilot/check-bug-claim-constant branch April 10, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: sidereal_day is off by factor 100

2 participants