Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Comprueba si los cálculos realiza en un tipo quedan libres de redondeo errores.
static const bool is_exact = false;
Valor devuelto
TRUE si los cálculos quedan libres de redondeo errores; Falso si no.
Comentarios
Todos los tipos enteros predefinidos tienen representaciones exactas para sus valores y Falsoreturn.Una representación de punto fijo o racional también se considera precisa, pero una representación de punto flotante no es.
Ejemplo
// 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;
}
Requisitos
encabezado: <límites>
espacio de nombres: std