From db0b35dcfaa2a77500393d917a2a1ef598b8bf36 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 29 Oct 2010 00:45:00 -0400 Subject: Fix dmnsn_print_polynomial again. --- libdimension/polynomial.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libdimension') diff --git a/libdimension/polynomial.c b/libdimension/polynomial.c index 5736a4d..228dc53 100644 --- a/libdimension/polynomial.c +++ b/libdimension/polynomial.c @@ -264,6 +264,8 @@ dmnsn_solve_polynomial(double poly[], size_t degree, double x[]) size_t i = 0; /* Index into x[] */ if (degree >= 3) { + dmnsn_print_polynomial(stdout, p, degree); + printf("\n"); /* Find isolating intervals for degree - 2 roots of p[] */ double ranges[degree - 2][2]; size_t n = dmnsn_uspensky_bounds(p, degree, ranges, degree - 2); @@ -308,7 +310,7 @@ dmnsn_print_polynomial(FILE *file, double poly[], size_t degree) if (i < degree) { fprintf(file, (poly[i] >= 0.0) ? " + " : " - "); } - fprintf(file, "%g", poly[i]); + fprintf(file, "%.15g", fabs(poly[i])); if (i >= 2) { fprintf(file, "*x^%zu", i); } else if (i == 1) { -- cgit v1.2.3