public void Divide(double scalar) {

        if (scalar == 0) {
            try {
                throw new ArithmeticException("Can not divide by zero.");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        this.real /= scalar;
        this.imaginary /= scalar;
    }
public void Divide ( double scalar ) { if ( scalar == 0 ) { try { throw new ArithmeticException ( "Can not divide by zero." ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } this . real /= scalar ; this . imaginary /= scalar ; }
Divides scalar value to a complex number.

@param scalar Scalar value.