Package org.flag4j.complex_numbers
Class CNumberParser
java.lang.Object
org.flag4j.complex_numbers.CNumberParser
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CNumber
parseNumber
(String num) Parses a complex number in the form of a string into its real and imaginary parts.
-
Constructor Details
-
CNumberParser
private CNumberParser()
-
-
Method Details
-
parseNumber
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 string num.
-