workaround for no c++11 numeric_limits