use crate::{
f16::F16,
+ prim::{PrimSInt, PrimUInt},
traits::{Bool, Compare, Context, ConvertFrom, Float, Int, Make, SInt, Select, UInt},
};
use core::ops::{
($($ty:ident),*) => {
$(
impl_int!($ty);
- impl UInt for Value<$ty> {}
+ impl UInt for Value<$ty> {
+ type PrimUInt = $ty;
+ type SignedType = Value<<$ty as PrimUInt>::SignedType>;
+ }
)*
};
}
($($ty:ident),*) => {
$(
impl_int!($ty);
- impl SInt for Value<$ty> {}
+ impl SInt for Value<$ty> {
+ type PrimSInt = $ty;
+ type UnsignedType = Value<<$ty as PrimSInt>::UnsignedType>;
+ }
)*
};
}
($ty:ident, $bits:ty, $signed_bits:ty) => {
impl_float_ops!($ty);
impl Float for Value<$ty> {
- type FloatEncoding = $ty;
+ type PrimFloat = $ty;
type BitsType = Value<$bits>;
type SignedBitsType = Value<$signed_bits>;
fn abs(self) -> Self {
#[cfg(feature = "std")]
return Value(self.0.abs());
#[cfg(not(feature = "std"))]
- todo!();
+ return crate::algorithms::base::abs(Scalar, self);
+ }
+ fn copy_sign(self, sign: Self) -> Self {
+ #[cfg(feature = "std")]
+ return Value(self.0.copysign(sign.0));
+ #[cfg(not(feature = "std"))]
+ return crate::algorithms::base::copy_sign(Scalar, self, sign);
}
fn trunc(self) -> Self {
#[cfg(feature = "std")]
return Value(self.0.trunc());
#[cfg(not(feature = "std"))]
- todo!();
+ return crate::algorithms::base::trunc(Scalar, self);
}
fn ceil(self) -> Self {
#[cfg(feature = "std")]
return Value(self.0.ceil());
#[cfg(not(feature = "std"))]
- todo!();
+ return crate::algorithms::base::ceil(Scalar, self);
}
fn floor(self) -> Self {
#[cfg(feature = "std")]
return Value(self.0.floor());
#[cfg(not(feature = "std"))]
- todo!();
+ return crate::algorithms::base::floor(Scalar, self);
}
fn round(self) -> 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 {