Prevent rounding of the GNSS from nanoseconds initializers#319
Merged
ChristopherRabotin merged 2 commits intomasterfrom Jul 22, 2024
Merged
Prevent rounding of the GNSS from nanoseconds initializers#319ChristopherRabotin merged 2 commits intomasterfrom
ChristopherRabotin merged 2 commits intomasterfrom
Conversation
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.
This issue was due to the
from_{GNSS}_nanosecondsfunctions which would round the input nanoseconds from au64into anf64. Now we initialize all GNSS time scales using the Duration'sfrom_partsfunction such that if a duration fits in nanoseconds u64 (i.e. is less than ~4.1 centuries long), then it will be "normalized" and initialized in this time scale.I added tests to confirm that this fix works for a recent-ish GPST nanoseconds. I could not add tests for any nanoseconds initialization which is more than one century away because the
to_{GNSS}_nanosecondsfunctions return an error if the centuries is non zero (as documented).Closes #317