C# Complex UnaryNegation

Description

Complex UnaryNegation Returns the additive inverse of a specified complex number.

Syntax

Complex.UnaryNegation has the following syntax.


public static Complex operator -(
  Complex value
)

Parameters

Complex.UnaryNegation has the following parameters.

  • value - The value to negate.

Returns

Complex.UnaryNegation method returns The result of the Real and Imaginary components of the value parameter multiplied by -1.

Example


//  w ww . java2 s.c o m
using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
        Complex c1 = new Complex(1.7, 3.9);
        Complex c2 = -c1;
        Console.WriteLine(c2);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Numerics »




BigInteger
Complex