summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <Pixel>2001-05-03 02:00:48 +0000
committerPixel <Pixel>2001-05-03 02:00:48 +0000
commit1c20afc6bfdbdc24fc59e68d3095ce6141c84cd6 (patch)
tree63c6fcfc2fae65c71e525df591465a29db563e9f
parent6afd90cf26b9dec429664fdda06d2b7ea9702548 (diff)
Hop
-rw-r--r--lib/pile.c16
-rw-r--r--lib/scalaires.c5
-rw-r--r--src/Polynom.c5
3 files changed, 17 insertions, 9 deletions
diff --git a/lib/pile.c b/lib/pile.c
index 6298b92..1f98941 100644
--- a/lib/pile.c
+++ b/lib/pile.c
@@ -459,14 +459,18 @@ void act_pile(int func)
_
("act_pile: OP_FUNC_CALL need only one argument for a polynom evaluation"));
}
- if (operande[0].poly->degre == 0) {
- push_pile_poly(ply_constr
- (ply_valuation(operande2.poly, operande[0].poly->coef), 0));
- if (operande[0].poly)
+ if (operande[0].poly) {
+ if (operande[0].poly->degre == 0) {
+ push_pile_poly(ply_constr
+ (ply_valuation(operande2.poly, operande[0].poly->coef), 0));
ply_destruct(operande[0].poly);
- ply_destruct(operande2.poly);
+ ply_destruct(operande2.poly);
+ } else {
+ exception(1, _("act_pile: OP_FUNC_CALL incorrect value for 2nd arg"));
+ }
} else {
- exception(1, _("act_pile: OP_FUNC_CALL incorrect value for 2nd arg"));
+ push_pile_poly(ply_constr(ply_valuation(operande2.poly, rat_constr_zero()), 0));
+ ply_destruct(operande2.poly);
}
} else {
exception(1, _("act_pile: OP_FUNC_CALL arg2 is an empty polynom"));
diff --git a/lib/scalaires.c b/lib/scalaires.c
index b0e9396..7240543 100644
--- a/lib/scalaires.c
+++ b/lib/scalaires.c
@@ -158,7 +158,10 @@ rationnel rat_pow(rationnel rat, unsigned int p)
{ /*
* puissance
*/
- for (; p; p--) {
+ if (p == 0) {
+ return rat_constr(1, 1);
+ }
+ for (p--; p; p--) {
rat = rat_multiplication(rat, rat);
}
return rat;
diff --git a/src/Polynom.c b/src/Polynom.c
index a80cafd..80e4448 100644
--- a/src/Polynom.c
+++ b/src/Polynom.c
@@ -75,8 +75,9 @@ int main(int argc, char **argv)
invite();
- signal(SIGSEGV, segfaulthand);
- signal(SIGINT, ctrlbreakhand);
+ /*
+ * signal(SIGSEGV, segfaulthand); signal(SIGINT, ctrlbreakhand);
+ */
fprintf(stderr, _("\nPerforming initialisation...\n\n"));
init_all(argv[1]);