top of page
On this page
Complex128
Flag4j has two built in implementations for complex numbers. This page covers Flag4j's 128-bit complex number.
The Complex128 class inherits from the Field interface and is immutable. This class represents a complex number in cartesian form using two 64-bit floats.
Initialization
A Complex128's value can be initialized from a single real value, two values specifying the real and imaginary component, a String, or a Complex64 object.
If a String is used to initialize a Complex128, it must adhere to the following grammar after all white space has been removed:
<COMPLEX_128> -> <DOUBLE> |
<DOUBLE> "i" |
<DOUBLE> <SIGN> <DOUBLE> "i"
<SIGN> -> + | -where <DOUBLE> must be parsable by Java's Double.valueOf().
The real and imaginary components can be extracted as follows:
Arithmetic
Complex128 objects support all basic arithmetic and trigonometric operations including: addition, subtraction, multiplication, division, exponentiation, logarithms, (hyperbolic) trig functions, etc.
For a full list of supported operations see the Javadoc API reference.
bottom of page