summaryrefslogtreecommitdiffstats
path: root/libdimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-10-29 00:45:00 -0400
committerTavian Barnes <tavianator@gmail.com>2010-10-29 00:45:00 -0400
commitdb0b35dcfaa2a77500393d917a2a1ef598b8bf36 (patch)
tree679ac3f4e28c49a937086cb368b1ae866d1a893a /libdimension
parent54f9b5e58befe75c22976cc48c381679a5127251 (diff)
downloaddimension-db0b35dcfaa2a77500393d917a2a1ef598b8bf36.tar.xz
Fix dmnsn_print_polynomial again.
Diffstat (limited to 'libdimension')
-rw-r--r--libdimension/polynomial.c4
1 files changed, 3 insertions, 1 deletions
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) {