From 2466c49d0c63f82a1b3a50a8b9d111d6b827aa41 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Fri, 25 Oct 2002 18:42:29 +0000 Subject: [PATCH] fixed a problem in the LaTeX-output of negative fractions --- ginac/numeric.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ginac/numeric.cpp b/ginac/numeric.cpp index a9f1c67b..a3872b96 100644 --- a/ginac/numeric.cpp +++ b/ginac/numeric.cpp @@ -322,8 +322,10 @@ static void print_real_number(const print_context & c, const cln::cl_R &x) !is_a(c)) { cln::print_real(c.s, ourflags, x); } else { // rational output in LaTeX context + if (x < 0) + c.s << "-"; c.s << "\\frac{"; - cln::print_real(c.s, ourflags, cln::numerator(cln::the(x))); + cln::print_real(c.s, ourflags, cln::abs(cln::numerator(cln::the(x)))); c.s << "}{"; cln::print_real(c.s, ourflags, cln::denominator(cln::the(x))); c.s << '}'; -- 2.45.0