std::numeric_limits::max_digits10
De cppreference.com
< cpp | types | numeric limits
![]() | Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate. La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
staticconstexprint max_digits10 | (desde C++11) | |
El valor de std::numeric_limits<T>::max_digits10 es el número de 10 dígitos de base que son necesarias para representar únicamente todos los valores distintos de la
T
tipo, tales como necesario para la serialización / deserialización al texto. Esta constante es significativa para todos los tipos de punto flotante . Original:
The value of std::numeric_limits<T>::max_digits10 is the number of base-10 digits that are necessary to uniquely represent all distinct values of the type
T
, such as necessary for serialization/deserialization to text. This constant is meaningful for all floating-point types. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar]Especializaciones estándar
T | valor de std::numeric_limits<T>::max_digits10 Original: value of std::numeric_limits<T>::max_digits10 The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
/* non-specialized */ | 0 |
bool | 0 |
char | 0 |
signedchar | 0 |
unsignedchar | 0 |
wchar_t | 0 |
char16_t | 0 |
char32_t | 0 |
short | 0 |
unsignedshort | 0 |
int | 0 |
unsignedint | 0 |
long | 0 |
unsignedlong | 0 |
longlong | 0 |
unsignedlonglong | 0 |
float | std::floor(std::numeric_limits<float>::digits*std::log10(2)+2) |
double | std::floor(std::numeric_limits<double>::digits*std::log10(2)+2) |
longdouble | std::floor(std::numeric_limits<longdouble>::digits*std::log10(2)+2) |
[editar]Notas
A diferencia de la mayoría de las operaciones matemáticas, la conversión de un valor de punto flotante en texto y en la espalda es exacta, siempre y cuando al menos
max_digits10
fueron utilizados (9 para float, 17 para double): está garantizado para producir la misma flotante valor de punto, a pesar de que la representación de texto intermedio no es exacto. Se puede tomar más de un centenar de dígitos decimales para representar el valor exacto de una float en notación decimal .Original:
Unlike most mathematical operations, the conversion of a floating-point value to text and back is exact as long as at least
max_digits10
were used (9 for float, 17 for double): it is guaranteed to produce the same floating-point value, even though the intermediate text representation is not exact. It may take over a hundred decimal digits to represent the precise value of a float in decimal notation.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar]Ver también
[estático] | la raíz o base entero utilizado por la representación del tipo dado Original: the radix or integer base used by the representation of the given type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante miembro pública estática) |
[estático] | número de dígitos radix que pueden ser representadas sin cambio Original: number of radix digits that can be represented without change The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante miembro pública estática) |
[estático] | número de dígitos decimales que pueden ser representadas sin cambio Original: number of decimal digits that can be represented without change The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante miembro pública estática) |
[estático] | más que la menor potencia negativa de la base de que es un válido punto flotante normalizado valor uno Original: one more than the smallest negative power of the radix that is a valid normalized floating-point value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante miembro pública estática) |
[estático] | mayor que la máxima potencia entera de la base de que es válida finito valor de punto flotante uno Original: one more than the largest integer power of the radix that is a valid finite floating-point value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante miembro pública estática) |