Programming classes

Constant functions cannot change the object's state. To avoid this we declare the function abs as

double Complex:: abs () const { return sqrt(re*re + im*im); }