diff options
-rw-r--r-- | lib/polynom.c | 2 | ||||
-rw-r--r-- | lib/scalaires.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/polynom.c b/lib/polynom.c index 8dcc567..dcd0386 100644 --- a/lib/polynom.c +++ b/lib/polynom.c @@ -273,7 +273,7 @@ char *ply_affichage(polynome poly) char temp[BUFSIZ]; int count = 0; - buf[0] = '0'; + buf[0] = '\0'; while (poly) { if (poly->degre != 0) { sprintf(temp, "%s*%s^%u ", rat_to_string(poly->coef), mute, poly->degre); diff --git a/lib/scalaires.c b/lib/scalaires.c index 509f126..49c243f 100644 --- a/lib/scalaires.c +++ b/lib/scalaires.c @@ -140,18 +140,18 @@ char *rat_to_string(rationnel rat) break; case HEX: if (rat.denom==1) - sprintf(temp,"%x", rat.num); + sprintf(temp,"0x%x", rat.num); else - sprintf(temp,"%x/%x", rat.num, rat.denom); + sprintf(temp,"0x%x/0x%x", rat.num, rat.denom); break; case OCT: if (rat.denom==1) - sprintf(temp,"%o", rat.num); + sprintf(temp,"0%o", rat.num); else - sprintf(temp,"%o/%o", rat.num, rat.denom); + sprintf(temp,"0%o/0%o", rat.num, rat.denom); break; case FLT: - sprintf(temp,"%f", rat_to_double(rat)); + sprintf(temp,"%g", rat_to_double(rat)); break; } |