Turtles all the way down
[ipdf/code.git] / src / gmprat.h
index 3e275d2..f5a2f1f 100644 (file)
@@ -103,6 +103,10 @@ class Gmprat
                
                Gmprat Abs() const {Gmprat a(*this); mpq_abs(a.m_op, a.m_op); return a;}
                
+               size_t Size() const
+               {
+                       return sizeof(uint64_t) * (mpq_numref(m_op)->_mp_alloc + mpq_denref(m_op)->_mp_alloc);
+               }
                
        private:
                friend std::ostream& operator<<(std::ostream& os, const Gmprat & fith);
@@ -115,6 +119,9 @@ inline std::ostream & operator<<(std::ostream & os, const Gmprat & fith)
        return os;
 }
 
+inline std::string Str(const Gmprat & g) {return g.Str();}
+inline double Log10(const Gmprat & g) {return g.Log10();}
+inline size_t Size(const Gmprat & g) {return g.Size();}
 
 
 

UCC git Repository :: git.ucc.asn.au