Commit 79374b86 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Revert change

Don't use lgammaf to calculate factorials
It doesn't work anymore, I'm unsure what happened TBH
parent ee5838ed
......@@ -359,9 +359,14 @@ Cn* reduceUnaryReal(Operator::OperatorType op, Cn* oper, QString** correct)
case Operator::minus:
oper->setValue(-a);
break;
case Operator::factorial:
oper->setValue(std::lgammaf(a));
break;
case Operator::factorial: {
//Use gamma from math.h?
uint res=1;
for(int i=a; i>1.; i--) {
res*=floor(i);
}
oper->setValue(res);
} break;
case Operator::sin:
oper->setValue(sin(a));
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment