Package net.sf.tweety.math
Class ComplexNumber
- java.lang.Object
-
- java.lang.Number
-
- net.sf.tweety.math.ComplexNumber
-
- All Implemented Interfaces:
java.io.Serializable
public class ComplexNumber extends java.lang.Number
A complex number.- Author:
- Matthias Thimm
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ComplexNumber(double real, double imag)
Constructs a new complex number with the given real and imaginary parts.
-
Method Summary
Modifier and Type Method 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()
java.lang.String
toString()
-
-
-
Method Detail
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValue
in classjava.lang.Number
-
intValue
public int intValue()
- Specified by:
intValue
in classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValue
in classjava.lang.Number
-
getRealPart
public double getRealPart()
Returns the real part of this complex number.- Returns:
- the real part of this complex number.
-
getImagPart
public double getImagPart()
Returns the imaginary part of this complex number.- Returns:
- the imaginary part of this complex number.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-