pub fn rounding_cmp(&self, other: &Self) -> Ordering {
        assert_eq!(self.layout(), other.layout(), "comparing numbers with different layout");
        match self.layout() {
            Layout::Integer(_) => self.cmp(other),
            Layout::Float(FloatLayout::FloatTapered) => {
                unimplemented!("512-bit tapered floats are not yet supported")
            }
            Layout::Float(float_layout) => {
                let last_bit = Number::masked_bit(
                    float_layout
                        .significand_pos()
                        .expect("non-tapered float layout does not provides significand position")
                        .end,
                    self.layout(),
                );
                (*self ^ last_bit).cmp(&(*other ^ last_bit))
            }
        }
    }
/// Does comparison by ignoring the difference in the last bit of significand for float layouts.
/// For integers performs normal comparison.
Does comparison by ignoring the difference in the last bit of significand for float layouts.
For integers performs normal comparison.
Does comparison by ignoring the difference in the last bit of significand for float layouts . For integers performs normal comparison .
pub fn rounding_cmp(&self, other: &Self) -> Ordering {
        assert_eq!(self.layout(), other.layout(), "comparing numbers with different layout");
        match self.layout() {
            Layout::Integer(_) => self.cmp(other),
            Layout::Float(FloatLayout::FloatTapered) => {
                unimplemented!("512-bit tapered floats are not yet supported")
            }
            Layout::Float(float_layout) => {
                let last_bit = Number::masked_bit(
                    float_layout
                        .significand_pos()
                        .expect("non-tapered float layout does not provides significand position")
                        .end,
                    self.layout(),
                );
                (*self ^ last_bit).cmp(&(*other ^ last_bit))
            }
        }
    }
pub fn rounding_cmp ( & self , other : & Self ) -> Ordering { assert_eq ! ( self layout ( ) other layout ( ) " " ) ; match self . layout ( ) { Layout :: Integer ( _ ) => self . cmp ( other ) , Layout :: Float ( FloatLayout :: FloatTapered ) => { unimplemented ! ( " " ) } Layout :: Float ( float_layout ) => { let last_bit = Number :: masked_bit ( float_layout . significand_pos ( ) . expect ( " " ) . end , self . layout ( ) , ) ; ( * self ^ last_bit ) . cmp ( & ( * other ^ last_bit ) ) } } }
Does comparison by ignoring the difference in the last bit of significand for float layouts.
Does comparison by ignoring the difference in the last bit of significand for float layouts .
&self
other
&Self
&self
other
&Self