public class ComplexNumber extends Number
| Modifier and Type | Field and Description |
|---|---|
static ComplexNumber |
I
Defining i
|
static ComplexNumber |
MINUS_I
Defining -i
|
static ComplexNumber |
ZERO
Defining 0 + 0i
|
| Constructor and Description |
|---|
ComplexNumber(double real)
Creates an instance from the real part.
|
ComplexNumber(double real,
double imaginary)
Creates an instance from the real and imaginary parts.
|
| Modifier and Type | Method and Description |
|---|---|
double |
doubleValue() |
boolean |
equals(Object obj) |
float |
floatValue() |
double |
getImaginary()
Gets the imaginary part.
|
double |
getReal()
Gets the real part.
|
int |
hashCode() |
int |
intValue() |
long |
longValue() |
String |
toString() |
byteValue, shortValuepublic static final ComplexNumber I
public static final ComplexNumber MINUS_I
public static final ComplexNumber ZERO
public ComplexNumber(double real)
real - the real partpublic ComplexNumber(double real,
double imaginary)
real - the real partimaginary - the imaginary partpublic double getReal()
public double getImaginary()
public double doubleValue()
doubleValue in class NumberUnsupportedOperationException - alwayspublic float floatValue()
floatValue in class NumberUnsupportedOperationException - alwayspublic int intValue()
intValue in class NumberUnsupportedOperationException - alwayspublic long longValue()
longValue in class NumberUnsupportedOperationException - alwaysCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.