-
Notifications
You must be signed in to change notification settings - Fork 69
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
Legible output for Instant #3048
Conversation
// obvious in the case of UTC, which is offset from TT(TAI) by an integer | ||
// number of milliseconds at any time. | ||
EXPECT_THAT((std::stringstream() << "2000-01-01T00:00:00"_UTC).str(), | ||
Eq("2000-01-01T00:01:04,1840000000011059 (TT)")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trailing 11059
is not significant, right? It might change if the implementation changes. I would use a regexp and leave these digits unspecified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation (of operator""_UTC) should be correctly-rounded (it is not, see the TODO below, this was found by looking at those « insignificant » digits, so they test something).
Barring changes of the value being formatted, these digits must not change, except possibly by one unit in the last place: the fractional part (stored in remainder
) is computed exactly, and we print 17 digits of it; if we cannot trust the binary-to-decimal code on seventeen digits we cannot ever hope that it will survive round-tripping.
Diff on top of #3050: https://github.com/mockingbirdnest/Principia/compare/9ce778f...eggrobin:tchouk-tchouk?expand=1.