fn as_integer_ratio(self) -> (i128, i128) {
        if self.n_frac_digits == 0 || self.coeff == 0 {
            // self is equivalent to an integer
            return (self.coeff, 1);
        }
        let gcd = gcd_special(self.coeff, self.n_frac_digits as u32);
        (self.coeff / gcd, self.denominator())
    }
/// Returns the pair of integers with the smallest positive denominator
/// from those with a ratio equal to `self`.
///
/// # Examples
///
/// ```rust
/// # use fpdec::{Dec, Decimal, AsIntegerRatio};
/// let d = Dec!(12345);
/// assert_eq!(d.as_integer_ratio(), (12345, 1));
/// let d = Dec!(28.27095);
/// assert_eq!(d.as_integer_ratio(), (565419, 20000));
/// ```
Returns the pair of integers with the smallest positive denominator
from those with a ratio equal to `self`.
Returns the pair of integers with the smallest positive denominator from those with a ratio equal to ` self ` .
fn as_integer_ratio(self) -> (i128, i128) {
        if self.n_frac_digits == 0 || self.coeff == 0 {
            // self is equivalent to an integer
            return (self.coeff, 1);
        }
        let gcd = gcd_special(self.coeff, self.n_frac_digits as u32);
        (self.coeff / gcd, self.denominator())
    }
fn as_integer_ratio ( self ) -> ( i128 , i128 ) { if self . n_frac_digits == 0 || self . coeff == 0 { // self is equivalent to an integer return ( self . coeff , 1 ) ; } let gcd = gcd_special ( self . coeff , self . n_frac_digits as u32 ) ; ( self . coeff / gcd , self . denominator ( ) ) }
Returns the pair of integers with the smallest positive denominator
from those with a ratio equal to `self`.
Returns the pair of integers with the smallest positive denominator from those with a ratio equal to ` self ` .
self
examples
None
use fpdec::{dec, decimal, asintegerratio};
None