X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fprint.cpp;h=2d3a936341b292e036f66f8f6cb7165ff34e6e61;hb=a5928fbda28b1b7f5b5939a9d49754660a0d546c;hp=6cfd0a1f8236a4fa5b9ff7e9b885654ce26ed173;hpb=6b3768e8c544739ae53321539cb4d1e3112ded1b;p=ginac.git diff --git a/ginac/print.cpp b/ginac/print.cpp index 6cfd0a1f..2d3a9363 100644 --- a/ginac/print.cpp +++ b/ginac/print.cpp @@ -1,11 +1,43 @@ /** @file print.cpp * * The methods .print() are responsible for the nice default-output of - * objects. All related helper-functions go in here as well. */ + * objects. All related helper-functions go in here as well. + * + * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include -#include "ginac.h" +#include "basic.h" +#include "ex.h" +#include "add.h" +#include "constant.h" +#include "expairseq.h" +#include "fail.h" +#include "indexed.h" +#include "inifcns.h" +#include "matrix.h" +#include "mul.h" +#include "ncmul.h" +#include "numeric.h" +#include "power.h" +#include "relational.h" +#include "series.h" +#include "symbol.h" void ex::print(ostream & os, unsigned upper_precedence) const { @@ -173,13 +205,13 @@ void add::print(ostream & os, unsigned upper_precedence) const os << "-"; } else { if (cit->coeff != 1) { - os << cit->coeff; + (cit->coeff).print(os,precedence); os << "*"; } } os << cit->rest; } - if (!overall_coeff.is_equal(exZERO())) { + if (!overall_coeff.is_zero()) { if (overall_coeff > 0) os << '+'; os << overall_coeff; }