]> www.ginac.de Git - ginac.git/commitdiff
synced to 1.0
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Fri, 25 Oct 2002 18:17:47 +0000 (18:17 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Fri, 25 Oct 2002 18:17:47 +0000 (18:17 +0000)
ginac/numeric.cpp

index 02fc17bf5fdb45ef7b1708939cbd21e81b6d5bf7..2483582325e72513487b21339b7b58bd15a52834 100644 (file)
@@ -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<print_csrc_cl_N>(c) && this->is_integer()) {
+                       c.s << "cln::cl_I(\"";
+                       const cln::cl_R r = cln::realpart(cln::the<cln::cl_N>(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<print_csrc_cl_N>(c))
@@ -382,7 +387,7 @@ void numeric::print(const print_context & c, unsigned level) const
                        c.s << ")";
                } else {
                        if (is_a<print_csrc_cl_N>(c))
-                               c.s << "cln::cl_F(\"" << evalf() << "\")";
+                               c.s << "cln::cl_F(\"" << evalf() << "_" << Digits << "\")";
                        else
                                c.s << to_double();
                }