Using C++ features for doing math.