Class definition for fixed point arithmetic in C++