Class ComplexNumberParser

java.lang.Object
org.flag4j.io.parsing.ComplexNumberParser

public final class ComplexNumberParser extends Object
A parser for parsing complex numbers represented as a string.
  • Method Details

    • parseNumberToComplex128

      public static Complex128 parseNumberToComplex128(String num)
      Parses a complex number in the form of a string into its real and imaginary parts. For example, the string "2+3i" would be parsed into real and imaginary parts 2 and 3 respectively.
      Parameters:
      num - Complex number in one of three forms: a + bi, a, or bi where a and b are real numbers and i is the imaginary unit sqrt(-1)
      Returns:
      The complex number represented by the num as a Complex128.
    • parseNumberToComplex64

      public static Complex64 parseNumberToComplex64(String num)
      Parses a complex number in the form of a string into its real and imaginary parts. For example, the string "2+3i" would be parsed into real and imaginary parts 2 and 3 respectively.
      Parameters:
      num - Complex number in one of three forms: a + bi, a, or bi where a and b are real numbers and i is the imaginary unit sqrt(-1)
      Returns:
      The complex number represented by the num as a Complex64.