#[cfg(not(feature = "std"))]
todo!();
}
+ /// round to nearest, ties to unspecified
pub fn round(self) -> Self {
- #[cfg(feature = "std")]
- return f32::from(self).round().to();
- #[cfg(not(feature = "std"))]
- todo!();
+ return PrimFloat::round(f32::from(self)).to();
}
#[cfg(feature = "fma")]
pub fn fma(self, a: Self, b: Self) -> Self {
}
fn is_finite(self) -> bool;
fn trunc(self) -> Self;
+ /// round to nearest, ties to unspecified
+ fn round(self) -> Self;
fn copy_sign(self, sign: Self) -> Self;
}
#[cfg(not(feature = "std"))]
return crate::algorithms::base::trunc(Scalar, Value(self)).0;
}
+ fn round(self) -> Self {
+ #[cfg(feature = "std")]
+ return $float::round(self);
+ #[cfg(not(feature = "std"))]
+ return crate::algorithms::base::round_to_nearest_ties_to_even(Scalar, Value(self))
+ .0;
+ }
fn copy_sign(self, sign: Self) -> Self {
#[cfg(feature = "std")]
return $float::copysign(self);
#[cfg(feature = "std")]
return Value(self.0.round());
#[cfg(not(feature = "std"))]
- todo!();
+ return crate::algorithms::base::round_to_nearest_ties_to_even(Scalar, self);
}
#[cfg(feature = "fma")]
fn fma(self, a: Self, b: Self) -> Self {