BigInteger.Subtract(BigInteger, BigInteger) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Soustrait une valeur d’une BigInteger autre 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 à soustraire (le minuend).
- right
- BigInteger
Valeur à soustraire (sous-trahend).
Retours
Résultat de la soustraction right de left.
Remarques
Les langages qui ne prennent pas en charge les opérateurs personnalisés peuvent utiliser la Subtract méthode pour effectuer une soustraction à l’aide BigInteger de valeurs.
La Subtract méthode est un substitut utile à 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);
let 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)