-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add round_to_iN() methods on f32 and f64
These methods perform the same thing as `round_ties()` and then a safe saturating cast. But that requires a separate instruction for the rounding and the casting. Some platforms have a single instruction that does both. So this gives access to that instruction while guarding for UB when the value is out of bounds for the target type and saturating, and returning 0 for NaN.
- Loading branch information
Showing
6 changed files
with
481 additions
and
113 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
Oops, something went wrong.