X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fgmprat.h;h=e0c9849a36455e97707aaabae2369efd9c6f9b8d;hp=f5a2f1f6520f34170094ef8711cf77cffda89742;hb=f0b6c9b6b95fde134927c395afbfbbbc057868e6;hpb=e08b7671a4592481aa73d68b30b7bd1d96e75002 diff --git a/src/gmprat.h b/src/gmprat.h index f5a2f1f..e0c9849 100644 --- a/src/gmprat.h +++ b/src/gmprat.h @@ -33,7 +33,7 @@ class Gmprat return "-" + operator-().Str(); } double p = Log10(); - if (isinf(p)) + if (std::isinf(p)) return "0"; int P = (int)p; @@ -103,6 +103,7 @@ 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); @@ -119,11 +120,14 @@ inline std::ostream & operator<<(std::ostream & os, const Gmprat & fith) return os; } + +#if REALTYPE != 9 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();} +inline Gmprat Abs(const Gmprat & g) {return g.Abs();} - +#endif #endif //_GMPRAT_H