diff options
-rw-r--r-- | lib/fonctions.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/lib/fonctions.c b/lib/fonctions.c index 94bb338..c99cbac 100644 --- a/lib/fonctions.c +++ b/lib/fonctions.c @@ -87,8 +87,9 @@ void printvars(polynome p1, polynome p2, polynome p3) } void ans(polynome p1, polynome p2, polynome p3) -{ polynome poly; - int valid; +{ + polynome poly; + int valid=0; polynome = return_last(&valid); if (valid) { @@ -117,22 +118,23 @@ void setdisplay(polynome p1, polynome p2, polynome p3) { if (p1) if ((!p1->degre)) - switch (p1->coef) { - case 1: - display=DEC; - break; - case 2: - display=HEX; - break; - case 3: - display=OCT; - break; - case 4: - display=FLT; - break; - default: - exception(1, _("setdisplay: invalid arg")); - } + if (p1->coef.denom==1) + switch (p1->coef.num) { + case 1: + display=DEC; + break; + case 2: + display=HEX; + break; + case 3: + display=OCT; + break; + case 4: + display=FLT; + break; + default: + exception(1, _("setdisplay: invalid arg")); + } } else { exception(1, _("setdisplay: invalid arg")); } |