1 |
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
|
2 |
The Forum is working with Sun on these issues.
|
3 |
One version of the constructor: Complex z = new Complex ( x, y ); // x and y are doubles
|
4 |
Syntax for operators: Complex z1, z2, z3; z1 = Complex.plus ( z2, z3 ) ; or z1 = z2.plus ( z3 ) ;
|
5 |
Many additional operators
|
6 |
Definitions based onC9x Annex G:"IEC 559-compatible complex arithmetic.
|