-macro_rules! impl_float {
- ($ty:ty, $bits:ty, $signed_bits:ty) => {
- impl Float for $ty {
- type FloatEncoding = $ty;
- type BitsType = $bits;
- type SignedBitsType = $signed_bits;
- fn abs(self) -> Self {
- #[cfg(feature = "std")]
- return self.abs();
- #[cfg(not(feature = "std"))]
- todo!();
- }
- fn trunc(self) -> Self {
- #[cfg(feature = "std")]
- return self.trunc();
- #[cfg(not(feature = "std"))]
- todo!();
- }
- fn ceil(self) -> Self {
- #[cfg(feature = "std")]
- return self.ceil();
- #[cfg(not(feature = "std"))]
- todo!();
- }
- fn floor(self) -> Self {
- #[cfg(feature = "std")]
- return self.floor();
- #[cfg(not(feature = "std"))]
- todo!();
- }
- fn round(self) -> Self {
- #[cfg(feature = "std")]
- return self.round();
- #[cfg(not(feature = "std"))]
- todo!();
- }
- #[cfg(feature = "fma")]
- fn fma(self, a: Self, b: Self) -> Self {
- self.mul_add(a, b)
- }
- fn is_nan(self) -> Self::Bool {
- self.is_nan()
- }
- fn is_infinite(self) -> Self::Bool {
- self.is_infinite()
- }
- fn is_finite(self) -> Self::Bool {
- self.is_finite()
- }
- fn from_bits(v: Self::BitsType) -> Self {
- <$ty>::from_bits(v)
- }
- fn to_bits(self) -> Self::BitsType {
- self.to_bits()
- }
- }
- };
-}
-
-impl_float!(f32, u32, i32);
-impl_float!(f64, u64, i64);
-