任何定义类型的最大值和最小值到底是什么?这可能吗?
unsigned int maximum_uint = (maximum_value)(unsigned int);
short minimum_short = (minimum_value)(short);
float maximum_float = (maximum_value)(float);
答案 0 :(得分:2)
答案 1 :(得分:2)
#include <limits>
unsigned int maximum_uint = std::numeric_limits<unsigned int>::max();
short minimum_short = std::numeric_limits<short>::min();
float maximum_float = std::numeric_limits<float>::max();