Class ComplexNumber

java.lang.Object
java.lang.Number
org.tweetyproject.math.ComplexNumber
All Implemented Interfaces:
Serializable

public class ComplexNumber extends Number
A complex number.
Author:
Matthias Thimm
See Also:
  • Constructor Details

    • ComplexNumber

      public ComplexNumber(double real, double imag)
      Constructs a new complex number with the given real and imaginary parts.
      Parameters:
      real - the real part.
      imag - the imaginary part.
  • Method Details

    • doubleValue

      public double doubleValue()
      Specified by:
      doubleValue in class Number
    • floatValue

      public float floatValue()
      Specified by:
      floatValue in class Number
    • intValue

      public int intValue()
      Specified by:
      intValue in class Number
    • longValue

      public long longValue()
      Specified by:
      longValue in class 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 String toString()
      Overrides:
      toString in class Object