Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meeus #3040

Merged
merged 8 commits into from
Jul 2, 2021
Merged

Meeus #3040

merged 8 commits into from
Jul 2, 2021

Conversation

eggrobin
Copy link
Member

Split off from #3034.
Use Meeus’s algorithms instead of attempting to hand-roll our own date arithmetic.
Add support for the (proleptic) Julian calendar; dates before 1583 must have a prefix J or G to indicate the calendar used.
Add support for a leading sign on years, to represent years before 0000 (1 BC).
Add an operator<<; check that its output parses correctly for all dates from JD0.5 to the Gröbner release.

constexpr Date DateParser::Parse(char const* const str,
std::size_t const size) {
return ReadToEnd(str, size).ToDate();
constexpr Date DateParser::Parse(char const* str,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

char const* const

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is incremented.

std::size_t const size) {
return ReadToEnd(str, size).ToDate();
constexpr Date DateParser::Parse(char const* str,
std::size_t size) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is decremented.

@pleroy pleroy added the LGTM label Jul 2, 2021
@eggrobin eggrobin merged commit b33a10e into mockingbirdnest:master Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants