You should perhaps explain what std::numeric_limits is or does, for those of us who know C# but not C++ (or at least haven't touched C++ for years ).