Trait mango_v4::i80f48::LowPrecisionDivision
source · [−]pub trait LowPrecisionDivision {
fn checked_div_30bit_precision(&self, rhs: I80F48) -> Option<I80F48>;
fn checked_div_f64_precision(&self, rhs: I80F48) -> Option<I80F48>;
}
Required Methods
source
fn checked_div_30bit_precision(&self, rhs: I80F48) -> Option<I80F48>
source
fn checked_div_f64_precision(&self, rhs: I80F48) -> Option<I80F48>
Implementations on Foreign Types
sourceimpl LowPrecisionDivision for I80F48
impl LowPrecisionDivision for I80F48
sourcefn checked_div_30bit_precision(&self, rhs: I80F48) -> Option<I80F48>
fn checked_div_30bit_precision(&self, rhs: I80F48) -> Option<I80F48>
Divide by taking the top 64 bits of self, and top 32 bits of rhs. Then divide those as u64 and shift everything back. Leads to a division result that has the first 30 bits correct.
sourcefn checked_div_f64_precision(&self, rhs: I80F48) -> Option<I80F48>
fn checked_div_f64_precision(&self, rhs: I80F48) -> Option<I80F48>
Convert to f64 and divide those.