# BigInteger.Negate(BigInteger) メソッド

## 定義

``````public:
static System::Numerics::BigInteger Negate(System::Numerics::BigInteger value);``````
``public static System.Numerics.BigInteger Negate (System.Numerics.BigInteger value);``
``static member Negate : System.Numerics.BigInteger -> System.Numerics.BigInteger``
``Public Shared Function Negate (value As BigInteger) As BigInteger``

value
BigInteger

#### 戻り値

BigInteger

`value` パラメーターに -1 を乗算した結果。The result of the `value` parameter multiplied by negative one (-1).

## 例

``````BigInteger number = 12645002;

Console.WriteLine(BigInteger.Negate(number));        // Displays -12645002
Console.WriteLine(-number);                          // Displays -12645002
Console.WriteLine(number * BigInteger.MinusOne);     // Displays -12645002
``````
``````Dim number As BigInteger = 12645002

Console.WriteLine(BigInteger.Negate(number))          ' Displays -12645002
Console.WriteLine(-number)                            ' Displays -12645002
Console.WriteLine(number * BigInteger.MinusOne)       ' Displays -12645002
``````

## 注釈

Negate メソッドは、カスタム演算子をサポートしない言語に対して実装されます。The Negate method is implemented for languages that do not support custom operators. その動作は、単項否定演算子を使用した否定と同じです。Its behavior is identical to negation using the unary negation operator. また、次の例に示すように、Negate メソッドは、BigInteger 変数をインスタンス化するときに、否定演算子の代替として使用できます。In addition, the Negate method is a useful substitute for the negation operator when instantiating a BigInteger variable, as shown in the following example.

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