Sdílet prostřednictvím


numeric_limits::is_exact

Testy na typu Výpočty jsou-li bez zaokrouhlení chyby.

static const bool is_exact = false;

Vrácená hodnota

true Pokud jsou výpočty bez zaokrouhlení chyby; false Pokud tomu tak není.

Poznámky

Všechny předdefinované celočíselné typy mají přesnou reprezentací pro jejich hodnot a vrátí false.S pevnou desetinnou čárkou nebo racionální zastoupení se rovněž považuje za přesné, ale není reprezentace s plovoucí desetinnou čárkou.

Příklad

// 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;
}
  

Požadavky

Záhlaví:<omezení>

Obor názvů: std

Viz také

Referenční dokumentace

strstreambuf – třída