withSimplifying static method

MathNode withSimplifying(
  1. MathNode left,
  2. MathNode right
)

Division with simplification of unary operations

Returns left operand if right operand equals 1

Implementation

static MathNode withSimplifying(MathNode left, MathNode right) {
  if (right == const MathValue(1)) return left;

  return MathOperatorDivision(left, right);
}