diff options
Diffstat (limited to 'lib/polynom.c')
-rw-r--r-- | lib/polynom.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/polynom.c b/lib/polynom.c index 241c2da..f9f3c1c 100644 --- a/lib/polynom.c +++ b/lib/polynom.c @@ -274,15 +274,9 @@ char *ply_affichage(polynome poly) while (poly) { if (poly->degre != 0) { - if (poly->coef.denom == 1) - sprintf(temp, "%+d*%s^%u ", poly->coef.num, mute, poly->degre); - else - sprintf(temp, "%+d/%d*%s^%u ", poly->coef.num, poly->coef.denom, mute, poly->degre); + sprintf(temp, "%s*%s^%u ", rat_to_string(poly->coef), mute, poly->degre); } else { - if (poly->coef.denom == 1) - sprintf(temp, "%+d ", poly->coef.num); - else - sprintf(temp, "%+d/%d ", poly->coef.num, poly->coef.denom); + sprintf(temp, "%s ", rat_to_string(poly->coef)); } count += strlen(temp); if (count < BUFSIZ) |