Commit 9f5f9175 authored by Daniel Simon's avatar Daniel Simon
Browse files

Operator for comparing MultiPrecision and mpf_t added. Needed for Google Test.

parent fcf2287c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -123,6 +123,16 @@ bool MultiPrecision::operator<=(const MultiPrecision &mp) const{
        return false;
}

/* OPERATORS FOR GOOGLE TEST */

bool MultiPrecision::operator==(const mpf_t &GMPnumber) const{
    MultiPrecision m (*this);
    if (mpf_cmp(m.number, GMPnumber) == 0)
        return true;
    else
        return false;
}

/* METHODS */

void MultiPrecision::printMP(){
+3 −0
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@ public:
    MultiPrecision operator++(int);
    MultiPrecision operator--(int);

    /* OPERATORS FOR GOOGLE TEST*/
    bool operator==(const mpf_t &GMPnumber) const;
    
    /* METHODS */
    void printMP();
    /// TODO void printNumber(int digits, ostream& str = std::cout );