BigInteger.Subtract(BigInteger, BigInteger) Méthode

Définition

Soustrait une valeur BigInteger d'une autre valeur et retourne le résultat.

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

Paramètres

left
BigInteger

Valeur à laquelle appliquer la soustraction (diminuende).

right
BigInteger

Valeur à soustraire (diminuteur).

Retours

BigInteger

Résultat de la soustraction de right de left.

Remarques

Les langages qui ne prennent pas en charge les opérateurs personnalisés peuvent utiliser la méthode pour effectuer la Subtract soustraction à l’aide de BigInteger valeurs.

La Subtract méthode est un substitut utile pour l’opérateur de soustraction lors de l’instanciation d’une BigInteger variable en lui affectant la différence qui résulte de la soustraction, comme illustré dans l’exemple suivant.

// 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)

S’applique à

Voir aussi