Home > Extreme Optimization Mathematics Library for .NET > Reference > Extreme.Mathematics Namespace


Extreme Optimization Mathematics Library for .NET

DoubleComplex Structure

Represents a complex number.

For a list of all members of this type, see DoubleComplex Members.

System.Object
   ValueType
      DoubleComplex

[Visual Basic]
Public Structure DoubleComplex
[C#]
public struct DoubleComplex

Remarks

The DoubleComplex value type represents a complex number made of double-precision, 64-bit real and imaginary parts.

DoubleComplex numbers arise in algebra in the solution of quadratic equations. The equation x2= –1 does not have any real solutions. However, if we define a new number, i as the square root of -1, then we have two solutions: i and -i.

This, in turn, gives rise to an entirely new class of numbers of the form a + ib with a and b real, and i defined as above. These are the complex numbers.

The DoubleComplex structure provides methods for all the common operations on complex numbers. The Re property returns the real component of the complex number, while Im returns the imaginary part. Because the complex numbers don't have a natural ordering, only equality and inequality operators are available.

Overloaded versions of the major arithmetic operators are provided for languages that support them. For languages that don't support operator overloading, equivalent static (Shared in Visual Basic) methods are supplied.

When performing binary operations, if one of the operands is a DoubleComplex, then the other operand is required to be an integral type or a floating-point type (Double or Single) or a complex type (DoubleComplex). Prior to performing the operation, if the other operand is not a DoubleComplex, it is converted to DoubleComplex, and the operation is performed using at least double precision. If the operation produces a numeric result, the type of the result is DoubleComplex.

Exceptions to this are methods that return a real property of a complex number: Argument, Modulus, ModulusSquared and Abs. These methods return a Double value.

The floating-point operators, including the assignment operators, do not throw exceptions. Instead, in exceptional situations, the result of a floating-point operation is zero, Infinity, or NaN, as described below:

Many elementary functions have been extended to the complex domain. These are implemented by static methods.

Some of these functions are multi-valued. If there is one real argument, then any symmetry or anti-symmetry about the origin is preserved. For example, the inverse sine function satisfies asin(-x) == -asin(x) for -1 <= x <= 1. The Asin method satisfies this relationship for any real value of x.

For complex arguments, the identity Conjugate(f(x)) == f(Conjugate(x)) is preserved. The branch cuts for all complex functions defined here are along either the real or the imaginary axis. Along the branch cuts, the functions have different values depending on whether the zero component is normal (positive) zero or negative zero.

The real and imaginary parts of DoubleComplex numbers are double-precision floating-point numbers.

Requirements

Namespace: Extreme.Mathematics

Assembly: Extreme.Mathematics (in Extreme.Mathematics.dll)

See Also

DoubleComplex Members | Extreme.Mathematics Namespace