[poincare] Enable functions with more than one argument

Change-Id: I543594072c37716fffcc54d5d6ba9b6b3499bcd1
This commit is contained in:
Émilie Feral
2017-01-03 17:21:52 +01:00
parent 1efb46e6ce
commit 628c5a91ca
8 changed files with 53 additions and 35 deletions

View File

@@ -18,11 +18,11 @@ Expression * AbsoluteValue::cloneWithDifferentOperands(Expression** newOperands,
int numberOfOperands, bool cloneOperands) const {
assert(numberOfOperands == 1);
assert(newOperands != nullptr);
AbsoluteValue * c = new AbsoluteValue();
c->setArgument(*newOperands, cloneOperands);
return c;
AbsoluteValue * a = new AbsoluteValue();
a->setArgument(newOperands, numberOfOperands, cloneOperands);
return a;
}
float AbsoluteValue::approximate(Context& context) const {
return fabsf(m_arg->approximate(context));
return fabsf(m_args[0]->approximate(context));
}