numeric_limits::round_style

Devuelve un valor que describe los diversos métodos que una implementación puede elegir para redondear un valor de punto flotante a un valor entero.

static const float_round_style round_style = round_toward_zero;

Valor devuelto

Un valor de enumeración de float_round_style que describe el estilo de redondeo.

Comentarios

El miembro almacena un valor que describe los diversos métodos que una implementación puede elegir para redondear un valor de punto flotante a un valor entero.

El estilo round es codificada duro en esta implementación, tan aunque los inicios de programa con otro modo de redondeo, que no cambiará.

Ejemplo

// numeric_limits_round_style.cpp
// compile with: /EHsc
#include <iostream>
#include <float.h>
#include <limits>

using namespace std;

int main( )
{
   cout << "The rounding style for a double type is: " 
        << numeric_limits<double>::round_style << endl;
   _controlfp_s(NULL,_RC_DOWN,_MCW_RC );
   cout << "The rounding style for a double type is now: " 
        << numeric_limits<double>::round_style << endl;
   cout << "The rounding style for an int type is: " 
        << numeric_limits<int>::round_style << endl;
}
  

Requisitos

encabezado: <límites>

espacio de nombres: std

Vea también

Referencia

strstreambuf Class