//operator int64_t() const {return mpq_get_si(m_op);}
//operator uint64_t() const {return mpq_get_ui(m_op);}
//operator double() const {return mpq_get_d(m_op);}
+ //operator float() const {return (float)ToDouble();}
double ToDouble() const {return mpq_get_d(m_op);}
std::string Str(int base = 10) const
{
}
Gmprat & operator=(const Gmprat & equ) {mpq_set(m_op, equ.m_op); return *this;}
+ Gmprat & operator=(const double & equ) {mpq_set_d(m_op, equ); return *this;}
Gmprat & operator+=(const Gmprat & add) {mpq_add(m_op, m_op, add.m_op); return *this;}
Gmprat & operator-=(const Gmprat & sub) {mpq_sub(m_op, m_op, sub.m_op); return *this;}
Gmprat & operator*=(const Gmprat & mul) {mpq_mul(m_op, m_op, mul.m_op); return *this;}
private:
+ friend std::ostream& operator<<(std::ostream& os, const Gmprat & fith);
mpq_t m_op;
};
+std::ostream & operator<<(std::ostream & os, const Gmprat & fith)
+{
+ os << fith.Str();
+ return os;
+}
+