pub fn div(self, other: Self) -> Result<Self, NumberError> {
        if let (Ok(a), Ok(b)) = (self.try_as_i128(), other.try_as_i128()) {
            if let Some(c) = a.checked_div(b) {
                return Ok(Self(N::I(c)));
            }
        }

        let denominator = f64::from(other);
        if denominator == 0.0 {
            // Divide by zero is _always_ NULL in SQL, never infinity.
            Err(NumberError::NaN)
        } else {
            Self::try_from((f64::from(self) / denominator).trunc())
        }
    }
/// Divides this number with another number, truncated as an integer towards zero.
Divides this number with another number, truncated as an integer towards zero.
Divides this number with another number truncated as an integer towards zero .
pub fn div(self, other: Self) -> Result<Self, NumberError> {
        if let (Ok(a), Ok(b)) = (self.try_as_i128(), other.try_as_i128()) {
            if let Some(c) = a.checked_div(b) {
                return Ok(Self(N::I(c)));
            }
        }
        let denominator = f64::from(other);
        if denominator == 0.0 {
            // Divide by zero is _always_ NULL in SQL, never infinity.
            Err(NumberError::NaN)
        } else {
            Self::try_from((f64::from(self) / denominator).trunc())
        }
    }
pub fn div ( self , other : Self ) -> Result < Self , NumberError > { if let ( Ok ( a ) , Ok ( b ) ) = ( self . try_as_i128 ( ) , other . try_as_i128 ( ) ) { if let Some ( c ) = a . checked_div ( b ) { return Ok ( Self ( N :: I ( c ) ) ) ; } } let denominator = f64 :: from ( other ) ; if denominator == 0.0 { // Divide by zero is _always_ NULL in SQL, never infinity. Err ( NumberError :: NaN ) } else { Self :: try_from ( ( f64 :: from ( self ) / denominator ) . trunc ( ) ) } }
Divides this number with another number, truncated as an integer towards zero.
Divides this number with another number truncated as an integer towards zero .
self
other
Self
self
other
Self