BigInteger.Subtract(BigInteger, BigInteger) Метод

Определение

Вычитает одно значение BigInteger из другого и возвращает результат.

public:
 static System::Numerics::BigInteger Subtract(System::Numerics::BigInteger left, System::Numerics::BigInteger right);
public static System.Numerics.BigInteger Subtract (System.Numerics.BigInteger left, System.Numerics.BigInteger right);
static member Subtract : System.Numerics.BigInteger * System.Numerics.BigInteger -> System.Numerics.BigInteger
Public Shared Function Subtract (left As BigInteger, right As BigInteger) As BigInteger

Параметры

left
BigInteger

Значение, из которого следует вычитать (уменьшаемое).

right
BigInteger

Значение для вычитания (вычитаемое).

Возвращаемое значение

BigInteger

Результат вычитания right из left.

Комментарии

Языки, не поддерживающие пользовательские операторы, могут использовать Subtract метод для вычитания с помощью BigInteger значений.

Метод Subtract является полезной заменой оператора вычитания при создании экземпляра переменной BigInteger , назначив ему разницу, которая приводит к вычитанию, как показано в следующем примере.

// The statement
//    BigInteger number = Int64.MinValue - Int64.MaxValue;
// produces compiler error CS0220: The operation overflows at compile time in checked mode.
// The alternative:
BigInteger number = BigInteger.Subtract(Int64.MinValue, Int64.MaxValue);
' The statement
'    Dim number As BigInteger = Int64.MinValue - Int64.MaxValue
' produces compiler error BC30439: Constant expression not representable in type 'Long'.
' The alternative:
Dim number As BigInteger = BigInteger.Subtract(Int64.MinValue, Int64.MaxValue)

Применяется к

См. также раздел