class Complex implements Serializable {

    public Complex div(final Complex c) {
	double dRe, dIm;
	double scalar;

	if (Math.abs(c.re) >= Math.abs(c.im)) {
	    scalar = 1.0 / (c.re + c.im * (c.im / c.re));

	    dRe = scalar * (re + im * (c.im / c.re));
	    dIm = scalar * (im - re * (c.im / c.re));

	} else {
	    scalar = 1.0 / (c.re * (c.re / c.im) + c.im);

	    dRe = scalar * (re * (c.re / c.im) + im);
	    dIm = scalar * (im * (c.re / c.im) - re);
	}// endif
	return Complex.cart(dRe, dIm);
    }

    private  Complex(final double re, final double im);

}