Maximum value of built-in types

#include <limits>
#define debug qDebug()<<
int main(int argc, char *argv[])
{
    debug "最大的int" <<std::numeric_limits<int>::max();
    debug "最小的int" <<std::numeric_limits<int>::min();
    debug "最大的uint" <<std::numeric_limits<uint>::max();
    debug "最小的uint" <<std::numeric_limits<uint>::min();
    debug "最大的double" <<std::numeric_limits<double>::max();
    debug "最小的double" <<std::numeric_limits<double>::min();
    debug "最大的float" <<std::numeric_limits<float>::max();
    debug "最小的float" <<std::numeric_limits<float>::min();
    debug "最大的long long" <<std::numeric_limits<long long>::max();
    debug "最小的long long" <<std::numeric_limits<long long>::min();
    debug "最大的uchar" <<std::numeric_limits<uchar>::max();
    debug "最小的uchar" <<std::numeric_limits<uchar>::min();
    debug "最大的short" <<std::numeric_limits<short>::max();
    debug "最小的short" <<std::numeric_limits<short>::min();
    debug "最大的bool" <<std::numeric_limits<bool>::max();
    debug "最小的bool" <<std::numeric_limits<bool>::min();
    debug "最大的wchar_t" <<std::numeric_limits<wchar_t>::max();
    debug "最小的wchar_t" <<std::numeric_limits<wchar_t>::min();
}

Guess you like

Origin blog.csdn.net/kenfan1647/article/details/114649042