Logo Search packages:      
Sourcecode: kbruch version File versions  Download package

ratio ratio::operator* ( ratio  factor )

operator overloading for: c = object * factor

Definition at line 198 of file ratio.cpp.

References denominator(), m_denominator, m_numerator, numerator(), reduce(), setDenominator(), and setNumerator().

Referenced by operator/().

{
    // this object will be returned as the product
    ratio product (0, 1);

    // calculate and set numerator and denominator without reducing
    product.setNumerator (m_numerator * factor.numerator(), false);
    product.setDenominator (m_denominator * factor.denominator(), false);

    // reduce the product
    product.reduce();

    return product;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index