public class ComplexNumber extends Number
| Constructor and Description |
|---|
ComplexNumber(double real,
double imag)
Constructs a new complex number with the given real
and imaginary parts.
|
| Modifier and Type | Method and Description |
|---|---|
double |
doubleValue() |
float |
floatValue() |
double |
getImagPart()
Returns the imaginary part of this complex number.
|
double |
getRealPart()
Returns the real part of this complex number.
|
int |
intValue() |
long |
longValue() |
String |
toString() |
byteValue, shortValuepublic ComplexNumber(double real,
double imag)
real - the real part.imag - the imaginary part.public double doubleValue()
doubleValue in class Numberpublic float floatValue()
floatValue in class Numberpublic double getRealPart()
public double getImagPart()
Copyright © 2018. All rights reserved.