Fixed-point arithmetic in C++