Complex numbers for Java

E cient and elegant complex numbers are one of the preconditions for the use of Java in scienti c computing. This paper introduces a preprocessor and its translation rules that map a new basic type complex and its operations to pure Java. For the mapping it is insu cient to just replace one complex-variable with two double-variables. Compared to code that uses Complex objects and method invocations to express arithmetic operations the new basic type increases readability and it is also executed faster. On average, the versions of our benchmark programs that use the basic type outperform the class-based versions by a factor of 2 up to 21 (depending on the JVM used).