Skip to content

Commit

Permalink
delete unused functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mwlon committed Aug 1, 2024
1 parent 94d3bc4 commit 4c4b13f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
8 changes: 3 additions & 5 deletions pco/src/data_types/floats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ fn choose_winning_bid<T: NumberLike>(bids: Vec<Bid<T>>) -> Bid<T> {
}

macro_rules! impl_float_like {
($t: ty, $latent: ty, $bits: expr, $exp_offset: expr) => {
($t: ty, $latent: ty, $exp_offset: expr) => {
impl FloatLike for $t {
const BITS: Bitlen = $bits;
/// Number of bits in the representation of the significand, excluding the implicit
/// leading bit. (In Rust, `MANTISSA_DIGITS` does include the implicit leading bit.)
const PRECISION_BITS: Bitlen = Self::MANTISSA_DIGITS as Bitlen - 1;
Expand Down Expand Up @@ -201,7 +200,6 @@ macro_rules! impl_float_like {
}

impl FloatLike for f16 {
const BITS: Bitlen = 16;
const PRECISION_BITS: Bitlen = Self::MANTISSA_DIGITS as Bitlen - 1;
const ZERO: Self = f16::ZERO;
const MAX_FOR_SAMPLING: Self = f16::from_bits(30719); // Half of MAX size.
Expand Down Expand Up @@ -391,8 +389,8 @@ macro_rules! impl_float_number_like {
};
}

impl_float_like!(f32, u32, 32, 127);
impl_float_like!(f64, u64, 64, 1023);
impl_float_like!(f32, u32, 127);
impl_float_like!(f64, u64, 1023);
// f16 FloatLike is implemented separately because it's non-native.
impl_float_number_like!(f32, u32, 1_u32 << 31, 5);
impl_float_number_like!(f64, u64, 1_u64 << 63, 6);
Expand Down
1 change: 0 additions & 1 deletion pco/src/data_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pub(crate) trait FloatLike:
+ SubAssign
+ Div<Output = Self>
{
const BITS: Bitlen;
/// Number of bits that aren't used for exponent or sign.
/// E.g. for f32 this should be 23.
const PRECISION_BITS: Bitlen;
Expand Down
3 changes: 0 additions & 3 deletions pco/src/read_write_uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pub trait ReadWriteUint:
+ Shr<Bitlen, Output = Self>
+ Sub<Output = Self>
{
const ZERO: Self;
const ONE: Self;
const BITS: Bitlen;
const MAX_U64S: usize = calc_max_u64s(Self::BITS);
Expand All @@ -55,7 +54,6 @@ pub trait ReadWriteUint:
}

impl ReadWriteUint for usize {
const ZERO: Self = 0;
const ONE: Self = 1;
const BITS: Bitlen = usize::BITS;

Expand All @@ -71,7 +69,6 @@ impl ReadWriteUint for usize {
}

impl<L: Latent> ReadWriteUint for L {
const ZERO: Self = <Self as Latent>::ZERO;
const ONE: Self = <Self as Latent>::ONE;
const BITS: Bitlen = <Self as Latent>::BITS;

Expand Down

0 comments on commit 4c4b13f

Please sign in to comment.