/// <summary> /// multiplies 2 digits given their positions /// </summary> /// <param name="digit1"></param> /// <param name="digit2"></param> /// <param name="digit1Pos"></param> /// <param name="digit2Pos"></param> /// <returns></returns> private Numeric MultiplyDigits(string digit1, string digit2, Numeric digit1Pos, Numeric digit2Pos) { Debug.WriteLine("multiplying digits {0} and {1} at positions {2} and {3}", digit1, digit2, digit1Pos.SymbolsText, digit2Pos.SymbolsText); var val = this._multMap.Get(digit1, digit2); Debug.WriteLine("{0} * {1} = {2}", digit1, digit2, val.SymbolsText); var rv = val.Clone().HasShift(); var number1 = Numeric.New(this.NumberSystem, digit1).HasShift(); var number2 = Numeric.New(this.NumberSystem, digit2).HasShift(); var counter = digit1Pos.HasAddition(); rv.ShiftRight(counter); number1.ShiftRight(counter); counter = digit2Pos.HasAddition(); rv.ShiftRight(counter); number2.ShiftRight(counter); Debug.WriteLine("equivalent to {0} * {1} = {2}", number1.SymbolsText, number2.SymbolsText, rv.SymbolsText); return rv.InnermostNumeric; }