Proposal for class Complex
The Java Grande forum has a draft proposal for a class to implement type Complex, although there are still several difficulties in having a class instead of a primitive type:
- syntax is methods, not operators
- assignment is of references, not values
- overhead of method calls may cause bad performance
The Forum is working with Sun on these issues.
One version of the constructor: Complex z = new Complex ( x, y ); // x and y are doubles
Syntax for operators: Complex z1, z2, z3; z1 = Complex.plus ( z2, z3 ) ; or z1 = z2.plus ( z3 ) ;
Many additional operators
Definitions based onC9x Annex G:"IEC 559-compatible complex arithmetic.