Use rint instead of roundeven
Use rint intrinsic instead of roundeven to impement `round_ties_even`. They do the same thing when rounding mode is default, which Rust assumes. And `rint` has better platform support. Keeps `roundeven` around in `core::intrinsics`, it's doing no harm there.
This commit is contained in:
parent
03c166d389
commit
f8138110bc
4 changed files with 12 additions and 7 deletions
|
@ -119,7 +119,7 @@ impl f64 {
|
|||
#[unstable(feature = "round_ties_even", issue = "96710")]
|
||||
#[inline]
|
||||
pub fn round_ties_even(self) -> f64 {
|
||||
unsafe { intrinsics::roundevenf64(self) }
|
||||
unsafe { intrinsics::rintf64(self) }
|
||||
}
|
||||
|
||||
/// Returns the integer part of `self`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue