pub fn int_div(self, rhs: Self, flags: IntFlags) -> Option<Number> {
        let layout = self.layout();
        assert_eq!(layout, rhs.layout(), "dividing numbers with different layout");

        if rhs.is_zero() {
            return None;
        }

        if self.is_zero() {
            return Some(Number::zero(layout));
        }

        match (layout, flags.signed) {
            (Layout::Integer(IntLayout { bytes, .. }), true) => {
                let res = match flags.wrap {
                    true => self.to_i1024_bytes().checked_div_euclid(rhs.to_i1024_bytes()),
                    false => self.to_i1024_bytes().checked_div(rhs.to_i1024_bytes()),
                };
                res.map(Number::from)
                    .and_then(|n| n.reshaped(Layout::signed(n.layout().bytes()), true))
                    .and_then(|n| n.reshaped(Layout::signed(bytes), false))
            }
            (Layout::Integer(IntLayout { bytes, .. }), false) => self
                .to_u1024_bytes()
                .checked_div(rhs.to_u1024_bytes())
                .map(Number::from)
                .and_then(|n| n.reshaped(Layout::signed(bytes), false)),
            (Layout::Float(_), _) => panic!("integer division of float numbers"),
        }
    }
/// Division of two integers with configuration flags for Euclidean division and signed format.
/// If `signed` flag is inconsistent with Number layout,
/// the layout will be discarded before computing.
///
/// # Panics
///
/// - if applied to float number layouts
/// - if numbers in arguments has different layout.
Division of two integers with configuration flags for Euclidean division and signed format.
If `signed` flag is inconsistent with Number layout,
the layout will be discarded before computing.
Division of two integers with configuration flags for Euclidean division and signed format . If ` signed ` flag is inconsistent with Number layout the layout will be discarded before computing .
pub fn int_div(self, rhs: Self, flags: IntFlags) -> Option<Number> {
        let layout = self.layout();
        assert_eq!(layout, rhs.layout(), "dividing numbers with different layout");
        if rhs.is_zero() {
            return None;
        }
        if self.is_zero() {
            return Some(Number::zero(layout));
        }
        match (layout, flags.signed) {
            (Layout::Integer(IntLayout { bytes, .. }), true) => {
                let res = match flags.wrap {
                    true => self.to_i1024_bytes().checked_div_euclid(rhs.to_i1024_bytes()),
                    false => self.to_i1024_bytes().checked_div(rhs.to_i1024_bytes()),
                };
                res.map(Number::from)
                    .and_then(|n| n.reshaped(Layout::signed(n.layout().bytes()), true))
                    .and_then(|n| n.reshaped(Layout::signed(bytes), false))
            }
            (Layout::Integer(IntLayout { bytes, .. }), false) => self
                .to_u1024_bytes()
                .checked_div(rhs.to_u1024_bytes())
                .map(Number::from)
                .and_then(|n| n.reshaped(Layout::signed(bytes), false)),
            (Layout::Float(_), _) => panic!("integer division of float numbers"),
        }
    }
pub fn int_div ( self , rhs : Self , flags : IntFlags ) -> Option < Number > { let layout = self . layout ( ) ; assert_eq ! ( layout rhs layout ( ) " " ) ; if rhs . is_zero ( ) { return None ; } if self . is_zero ( ) { return Some ( Number :: zero ( layout ) ) ; } match ( layout , flags . signed ) { ( Layout :: Integer ( IntLayout { bytes , .. } ) , true ) => { let res = match flags . wrap { true => self . to_i1024_bytes ( ) . checked_div_euclid ( rhs . to_i1024_bytes ( ) ) , false => self . to_i1024_bytes ( ) . checked_div ( rhs . to_i1024_bytes ( ) ) , } ; res . map ( Number :: from ) . and_then ( | n | n . reshaped ( Layout :: signed ( n . layout ( ) . bytes ( ) ) , true ) ) . and_then ( | n | n . reshaped ( Layout :: signed ( bytes ) , false ) ) } ( Layout :: Integer ( IntLayout { bytes , .. } ) , false ) => self . to_u1024_bytes ( ) . checked_div ( rhs . to_u1024_bytes ( ) ) . map ( Number :: from ) . and_then ( | n | n . reshaped ( Layout :: signed ( bytes ) , false ) ) , ( Layout :: Float ( _ ) , _ ) => panic ! ( " " ) , } }
Division of two integers with configuration flags for Euclidean division and signed format.
Division of two integers with configuration flags for Euclidean division and signed format .
self
rhs
Self
flags
IntFlags
self
rhs
Self
flags
IntFlags
panics
if applied to float number layouts
if numbers in arguments has different layout.
if applied to float number layouts if numbers in arguments has different layout .