Пример #1
0
        public AddDigitOperationLine(Numeric number1, Numeric number2, Numeric orderOfMagnitude)
        {
            this.OrderOfMagnitude = orderOfMagnitude;
            var digit1 = number1.GetDigitAtMagnitude(orderOfMagnitude);
            var digit2 = number2.GetDigitAtMagnitude(orderOfMagnitude);

            var newDigit1 = number1.GetCompatibleNumber(digit1.Symbol);
            var newDigit2 = number2.GetCompatibleNumber(digit2.Symbol);
            var result = newDigit1.Clone();
            result.HasAddition().Add(newDigit2);

            this.Digit1 = digit1.Symbol;
            this.Digit2 = digit2.Symbol;
            this.ResultDigit = result.ZerothDigit.Value.Symbol;
            if(result.ZerothDigit.NextNode != null)
            {
                this.CarryDigit = result.ZerothDigit.NextDigit().Value.Symbol;
            }
        }