Package org.tweetyproject.math
Class ComplexNumber
- java.lang.Object
-
- java.lang.Number
-
- org.tweetyproject.math.ComplexNumber
-
- All Implemented Interfaces:
java.io.Serializable
public class ComplexNumber extends java.lang.NumberA 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()java.lang.StringtoString()
-
-
-
Method Detail
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValuein classjava.lang.Number
-
intValue
public int intValue()
- Specified by:
intValuein classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValuein 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:
toStringin classjava.lang.Object
-
-