Class ComplexNumberParser
java.lang.Object
org.flag4j.io.parsing.ComplexNumberParser
A parser for parsing complex numbers represented as a string.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Complex128Parses a complex number in the form of a string into its real and imaginary parts.static Complex64Parses a complex number in the form of a string into its real and imaginary parts.
-
Method Details
-
parseNumberToComplex128
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 parts2and3respectively.- Parameters:
num- Complex number in one of three forms:a + bi, a,orbiwhere a and b are real numbers and i is the imaginary unit sqrt(-1)- Returns:
- The complex number represented by the
numas aComplex128.
-
parseNumberToComplex64
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 parts2and3respectively.- Parameters:
num- Complex number in one of three forms:a + bi, a,orbiwhere a and b are real numbers and i is the imaginary unit sqrt(-1)- Returns:
- The complex number represented by the
numas aComplex64.
-