+macro_rules! impl_float {
+ ($ty:ty, $bits:ty) => {
+ impl Float<u32> for $ty {
+ type BitsType = $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);
+impl_float!(f64, u64);
+