public override TANumber Inverse()
        {
            errorLength = 15;

            TPNumber result = new TPNumber(value, Convert.ToString(radix), Convert.ToString(errorLength));

            result.value = Convert.ToString(ConverterFrom10.Convert(Math.Round(1 / ConverterTo10.Convert(value, radix), errorLength), radix, errorLength));

            return(result);
        }
        public override TANumber Divide(TANumber otherNumber)
        {
            TPNumber result = new TPNumber();

            result.errorLength = otherNumber.ErrorLengthNumber + errorLength;
            result.value       = Convert.ToString(ConverterFrom10.Convert(ConverterTo10.Convert(ValueString, radix) /
                                                                          ConverterTo10.Convert(otherNumber.ValueString, otherNumber.RadixNumber), otherNumber.RadixNumber, result.errorLength));
            result.radix = otherNumber.RadixNumber;

            return(result);
        }
        public override TANumber Add(TANumber otherNumber)
        {
            TPNumber result = new TPNumber();

            result.errorLength = otherNumber.ErrorLengthNumber + errorLength;
            double sum = ConverterTo10.Convert(otherNumber.ValueString, otherNumber.RadixNumber) +
                         ConverterTo10.Convert(ValueString, radix);

            result.value       = Convert.ToString(ConverterFrom10.Convert(sum, otherNumber.RadixNumber, result.errorLength));
            result.radix       = otherNumber.RadixNumber;
            result.errorLength = Math.Max(otherNumber.ErrorLengthNumber, errorLength);

            return(result);
        }
 //Изменяет значение основания с.сч. исходного числа.
 private void sourceRadix_ValueChanged(object sender, EventArgs e)
 {
     //Обновить состояние.
     sourceNumber.Text     = ConverterFrom10.Convert(ConverterTo10.Convert(sourceNumber.Text, prevRadix), Convert.ToInt32(sourceRadix.Value), 100);
     prevRadix             = Convert.ToInt32(sourceRadix.Value);
     control.Editor.Number = sourceNumber.Text;
     control.Radix         = (int)sourceRadix.Value;
     if (control.Editor.state == AEditor.State.Choose || control.Editor.state == AEditor.State.EditRight || control.Editor.state == AEditor.State.Print)
     {
         control.processor.RightOperand = new TPNumber(sourceNumber.Text, control.Radix.ToString(), control.processor.RightOperand.ErrorLengthString);
     }
     else
     {
         if (control.processor.LeftOperand != null)
         {
             control.processor.LeftOperand = new TPNumber(sourceNumber.Text, control.Radix.ToString(), control.processor.LeftOperand.ErrorLengthString);
         }
     }
     //Обновить состояние командных кнопок.
     this.UpdateP1();
 }