Port Duration::from_secs_f32|64 from std#576
Merged
jhpratt merged 1 commit intotime-rs:mainfrom May 10, 2023
Merged
Conversation
bde3232 to
97ac8d9
Compare
Codecov Report
@@ Coverage Diff @@
## main #576 +/- ##
=====================================
Coverage 95.7% 95.7%
=====================================
Files 79 79
Lines 8779 8795 +16
=====================================
+ Hits 8405 8421 +16
Misses 374 374
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
97ac8d9 to
744a99f
Compare
This ports the algorithm for constructing `Duration` from floating point seconds from `std`. The new algorithm in `std` uses bit manipulation to construct the `Duration` with the most precision possible. Additionally this adds `saturating` and `checked` variants of those functions. Original `std` PR: rust-lang/rust#90247 Co-authored-by: Ted Wollman <25165500+TheTedder@users.noreply.github.com>
744a99f to
d6cdb26
Compare
Member
|
Having this code and the code from I have no changes to request, so I'm merging it as-is. Thank you for the PR! |
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 ports the algorithm for constructing
Durationfrom floating point seconds fromstd. The new algorithm instduses bit manipulation to construct theDurationwith the most precision possible. Additionally this addssaturatingandcheckedvariants of those functions.Original
stdPR: rust-lang/rust#90247