From 3ced416a68d77aea2d4dc1a65e4ce54ff9e1a271 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Fri, 25 Oct 2002 18:17:47 +0000 Subject: [PATCH] synced to 1.0 --- ginac/numeric.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ginac/numeric.cpp b/ginac/numeric.cpp index 02fc17bf..24835823 100644 --- a/ginac/numeric.cpp +++ b/ginac/numeric.cpp @@ -360,7 +360,12 @@ void numeric::print(const print_context & c, unsigned level) const c.s.precision(16); else c.s.precision(7); - if (this->is_rational() && !this->is_integer()) { + if (is_a(c) && this->is_integer()) { + c.s << "cln::cl_I(\""; + const cln::cl_R r = cln::realpart(cln::the(value)); + print_real_number(c,r); + c.s << "\")"; + } else if (this->is_rational() && !this->is_integer()) { if (compare(_num0) > 0) { c.s << "("; if (is_a(c)) @@ -382,7 +387,7 @@ void numeric::print(const print_context & c, unsigned level) const c.s << ")"; } else { if (is_a(c)) - c.s << "cln::cl_F(\"" << evalf() << "\")"; + c.s << "cln::cl_F(\"" << evalf() << "_" << Digits << "\")"; else c.s << to_double(); } -- 2.50.0