mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 07:40:42 +01:00
[poincare] Use new API in AbsoluteValue
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Poincare {
|
||||
class Context;
|
||||
|
||||
class Expression : public TreeByReference {
|
||||
friend class AbsoluteValue;
|
||||
friend class CosineNode;
|
||||
friend class SineNode;
|
||||
friend class ExpressionNode;
|
||||
|
||||
@@ -43,19 +43,22 @@ Expression AbsoluteValue::shallowReduce(Context & context, Preferences::AngleUni
|
||||
if (e.isUndefinedOrAllocationFailure()) {
|
||||
return e;
|
||||
}
|
||||
Expression op = childAtIndex(0);
|
||||
Expression c = childAtIndex(0);
|
||||
#if MATRIX_EXACT_REDUCING
|
||||
#if 0
|
||||
if (op->type() == Type::Matrix) {
|
||||
if (c->type() == Type::Matrix) {
|
||||
return SimplificationHelper::Map(this, context, angleUnit);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if (op.sign() == ExpressionNode::Sign::Positive) {
|
||||
return op;
|
||||
if (c.sign() == ExpressionNode::Sign::Positive) {
|
||||
replaceWithInPlace(c);
|
||||
return c;
|
||||
}
|
||||
if (op.sign() == ExpressionNode::Sign::Negative) {
|
||||
return op.setSign(ExpressionNode::Sign::Positive, context, angleUnit);
|
||||
if (c.sign() == ExpressionNode::Sign::Negative) {
|
||||
Expression result = c.setSign(ExpressionNode::Sign::Positive, context, angleUnit);
|
||||
replaceWithInPlace(result);
|
||||
return result;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user