diff options
author | biouman <biouman> | 2001-04-29 23:07:08 +0000 |
---|---|---|
committer | biouman <biouman> | 2001-04-29 23:07:08 +0000 |
commit | 67cc2ba2e81241774373f4667f1bac71234ecf11 (patch) | |
tree | d6e0cc3364703ad3b13fd7e4621ce2f22fd5b7b7 /lib | |
parent | 6a27e9676e432ae176ff00d8fd7336a7a86bf9a2 (diff) |
*** empty log message ***
Diffstat (limited to 'lib')
-rw-r--r-- | lib/polynom.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/polynom.c b/lib/polynom.c index dcd3b4f..aea2675 100644 --- a/lib/polynom.c +++ b/lib/polynom.c @@ -268,9 +268,15 @@ char *ply_affichage(polynome poly) while (poly) { if (poly->degre != 0) { - sprintf(temp, "%+f*%s^%u", rat_to_double(poly->coef), mute, poly->degre); + 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); } else { - sprintf(temp, "%+f", rat_to_double(poly->coef)); + if (poly->coef.denom==1) + sprintf(temp, "%+d ", poly->coef.num); + else + sprintf(temp, "%+d/%d ", poly->coef.num , poly->coef.denom); } strcat(buf, temp); /* FIXME: gerer le depassement de buf si po malloc */ poly=poly->suiv; |