This could be a helper function in CMath, then it doesnt need to be redefined in all the unit tests