Package net.sf.tweety.math
Class ComplexNumber
- java.lang.Object
-
- java.lang.Number
-
- net.sf.tweety.math.ComplexNumber
-
- All Implemented Interfaces:
Serializable
public class ComplexNumber extends 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 doubledoubleValue()floatfloatValue()doublegetImagPart()Returns the imaginary part of this complex number.doublegetRealPart()Returns the real part of this complex number.intintValue()longlongValue()StringtoString()-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Method Detail
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein classNumber
-
floatValue
public float floatValue()
- Specified by:
floatValuein classNumber
-
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.
-
-