You know what really hurts? A missing round() function if you really need it. Here is a code snippet for all of those with the same problem.

  1. template <class T>
  2. inline T round(float num)
  3. {
  4.    return static_cast<T>((num>0.0f) ? num+0.5f : num-0.5f);
  5. }