Rubberduck.Parsing.Preprocessing.BinaryIntDivExpression.Evaluate C# (CSharp) Method

Evaluate() public method

public Evaluate ( ) : IValue
return IValue
        public override IValue Evaluate()
        {
            var left = _left.Evaluate();
            var right = _right.Evaluate();
            if (left == null || right == null)
            {
                return null;
            }
            var leftValue = Convert.ToInt64(left.AsDecimal);
            var rightValue = Convert.ToInt64(right.AsDecimal);
            return new DecimalValue(Math.Truncate((decimal)leftValue / rightValue));
        }
    }