[poincare] Integer: fix and add tests on Factorial

This commit is contained in:
Émilie Feral
2018-08-16 11:18:44 +02:00
parent e0dbb59c20
commit 3371d41b2c
2 changed files with 9 additions and 1 deletions

View File

@@ -336,7 +336,7 @@ Integer NaturalIntegerAbstract::upow(const NaturalIntegerAbstract * i, const Nat
Integer NaturalIntegerAbstract::ufact(const NaturalIntegerAbstract * i) {
Integer j(2);
Integer result(1);
while (ucmp(i,j.node()) > 0) {
while (ucmp(i,j.node()) >= 0) {
result = Integer::Multiplication(j, result);
j = Integer::Addition(j, Integer(1));
}