Class ComplexNumber

    • Constructor Detail

      • 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 Detail

      • 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.