numeric_limits::is_modulo

如果 type 有一个取模表示,测试。

static const bool is_modulo = false;

返回值

true,如果该类型具有一个取模表示; false,如果没有。

备注

取模表示为所有结果都是减少取模某个值的表示形式。所有的预定义无符号整数类型都有一个取模表示。

示例

// numeric_limits_is_modulo.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>

using namespace std;

int main( )
{
   cout << "Whether float objects have a modulo representation: "
        << numeric_limits<float>::is_modulo
        << endl;
   cout << "Whether double objects have a modulo representation: "
        << numeric_limits<double>::is_modulo
        << endl;
   cout << "Whether signed char objects have a modulo representation: "
        << numeric_limits<signed char>::is_modulo
        << endl;
   cout << "Whether unsigned char objects have a modulo representation: "
        << numeric_limits<unsigned char>::is_modulo
        << endl;
}
  

要求

标头: <limits>

命名空间: std

请参见

参考

strstreambuf Class