use crate::{
f16::F16,
+ scalar::{Scalar, Value},
traits::{ConvertFrom, ConvertTo},
};
use core::{fmt, hash, ops};
fn from_bits(bits: Self::BitsType) -> Self;
fn to_bits(self) -> Self::BitsType;
fn abs(self) -> Self;
+ fn max_contiguous_integer() -> Self {
+ (Self::BitsType::cvt_from(1) << (Self::MANTISSA_FIELD_WIDTH + 1.to())).to()
+ }
+ fn is_finite(self) -> bool;
+ fn trunc(self) -> Self;
}
macro_rules! impl_float {
#[cfg(feature = "std")]
return $float::abs(self);
#[cfg(not(feature = "std"))]
- todo!();
+ return crate::algorithms::base::abs(Scalar, Value(self)).0;
+ }
+ fn is_finite(self) -> bool {
+ $float::is_finite(self)
+ }
+ fn trunc(self) -> Self {
+ #[cfg(feature = "std")]
+ return $float::trunc(self);
+ #[cfg(not(feature = "std"))]
+ return crate::algorithms::base::trunc(Scalar, Value(self)).0;
}
}
};