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 Complex128
Parses a complex number in the form of a string into its real and imaginary parts.static Complex64
Parses 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 parts2
and3
respectively.- Parameters:
num
- Complex number in one of three forms:a + bi, a,
orbi
where a and b are real numbers and i is the imaginary unit sqrt(-1)- Returns:
- The complex number represented by the
num
as 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 parts2
and3
respectively.- Parameters:
num
- Complex number in one of three forms:a + bi, a,
orbi
where a and b are real numbers and i is the imaginary unit sqrt(-1)- Returns:
- The complex number represented by the
num
as aComplex64
.
-