int float double 最小值与最大值

#include <iostream>
#include <limits>
using   namespace   std;

int  main()
{
    cout << "bool minvalue " << numeric_limits<bool>::min() << endl;
    cout << "bool maxvalue " << numeric_limits<bool>::max() << endl;
    cout << "char minvalue " << numeric_limits<char>::min() << endl;
    cout << "char maxvalue " << numeric_limits<char>::max() << endl;
    cout << "short minvalue " << numeric_limits<short>::min() << endl;
    cout << "short maxvalue " << numeric_limits<short>::max() << endl;
    cout << "int minvalue " << numeric_limits<int>::min() << endl;
    cout << "int maxvalue " << numeric_limits<int>::max() << endl;
    cout << "long minvalue " << numeric_limits<long>::min() << endl;
    cout << "long maxvalue " << numeric_limits<long>::max() << endl;
    cout << "float minvalue " << numeric_limits<float>::min() << endl;
    cout << "float maxvalue " << numeric_limits<float>::max() << endl;
    cout << "double minvalue " << numeric_limits<double>::min() << endl;
    cout << "double maxvalue " << numeric_limits<double>::max() << endl;
    cout << "long double minvalue " << numeric_limits<long double>::min() << endl;
    cout << "long double maxvalue " << numeric_limits<long double>::max() << endl;
    return 0;
}

posted @ 2019-04-11 13:59  narjaja  阅读(732)  评论(0编辑  收藏  举报