Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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(){
......
......@@ -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 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment