Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a saturating conversion from time::Duration
Given the prior usage, it does not make much sense to provide an exact conversion. However, it should be clear that precision is not finite and the representation is not exactly that of a Duration. The implementation turned out to be fairly involved as the num-fraction crate does not provide approximation algorithms for fractions. No fear, we code them ourselves with extensive testing to cover much more than the required accuracy tests.
- Loading branch information
1 parent
633f247
commit b6dacab
Showing
1 changed file
with
170 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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