numeric_limits::is_exact
경우 계산 유형에 따라 수행 가능한 반올림 오류를 테스트 합니다.
static const bool is_exact = false;
반환 값
true 이면 계산 무료 반올림 오류;의 경우 false 이면 하지 않으면.
설명
모든 미리 정의 된 정수 값에 대 한 정확한 표현이 형식과 반환 거짓.부동 소수점 표현 없는 고정 소수점 또는 유리수 표현, 정확 하 게 간주 됩니다.
예제
// numeric_limits_is_exact.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << "Whether float objects have calculations "
<< "free of rounding errors: "
<< numeric_limits<float>::is_exact
<< endl;
cout << "Whether double objects have calculations "
<< "free of rounding errors: "
<< numeric_limits<double>::is_exact
<< endl;
cout << "Whether long int objects have calculations "
<< "free of rounding errors: "
<< numeric_limits<long int>::is_exact
<< endl;
cout << "Whether unsigned char objects have calculations "
<< "free of rounding errors: "
<< numeric_limits<unsigned char>::is_exact
<< endl;
}
요구 사항
헤더: <limits>
네임 스페이스: std