From be25152c720d17c0c804dfd8e6bf247c89dd6dda Mon Sep 17 00:00:00 2001 From: Kaspar Fischer Date: Thu, 3 Apr 2003 08:54:50 +0000 Subject: [PATCH] - Output of rationals is now only enabled if at least GMP 4.0 is present. This fixes a compilation problem when only an older version of GMP is available. --- .../test/Min_sphere_of_spheres_d/Rational.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Packages/Min_sphere_of_spheres_d/test/Min_sphere_of_spheres_d/Rational.h b/Packages/Min_sphere_of_spheres_d/test/Min_sphere_of_spheres_d/Rational.h index 167d9146e35..ce6ef64c101 100644 --- a/Packages/Min_sphere_of_spheres_d/test/Min_sphere_of_spheres_d/Rational.h +++ b/Packages/Min_sphere_of_spheres_d/test/Min_sphere_of_spheres_d/Rational.h @@ -63,6 +63,7 @@ public: // conversion: return mpq_get_d(r); } + #if (__GNU_MP_VERSION >= 4) std::string toString() const { const int Base = 10; const int size = mpz_sizeinbase (mpq_numref(r),Base) + @@ -73,6 +74,7 @@ public: // conversion: delete str; return s; } + #endif public: // comparision: bool operator==(const Rational& x) const { @@ -164,9 +166,11 @@ Rational operator/(const Rational& x,const Rational& y) { return z; } +#if (__GNU_MP_VERSION >= 4) std::ostream& operator<<(std::ostream& out,const Rational& r) { return out << r.toString(); } +#endif double to_double(const Rational& x) { return x.toDouble();