Floating-point environment
De cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
El entorno de punto flotante es el conjunto de indicadores de estado de coma flotante y modos de control soportados por la implementación. Es subproceso local, cada hilo hereda el estado inicial de su entorno de punto flotante de la rosca padre. Operaciones de punto flotante modificar los indicadores de estado de coma flotante para indicar los resultados anormales o información auxiliar. El estado de los modos de control de punto flotante afecta a los resultados de algunas operaciones de punto flotante .
Original:
The floating-point environment is the set of floating-point status flags and control modes supported by the implementation. It is thread-local, each thread inherits the initial state of its floating-point environment from the parent thread. Floating-point operations modify the floating-point status flags to indicate abnormal results or auxiliary information. The state of floating-point control modes affects the outcomes of some floating-point operations.
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.
El acceso a las instalaciones de punto flotante y la modificación sólo tiene sentido cuando se establece
#pragma STDC FENV_ACCESS
ON
. De lo contrario la aplicación es libre de asumir que coma flotante modos de control son siempre los que vienen por defecto y que los indicadores de estado de coma flotante nunca se han comprobado o modificado. En la práctica, son pocos los compiladores actuales apoyan la #pragma
explícitamente, pero la mayoría de los compiladores permiten un acceso significativo al medio ambiente de punto flotante de todos modos .Original:
The floating-point environment access and modification is only meaningful when
#pragma STDC FENV_ACCESS is set to
ON
. Otherwise the implementation is free to assume that floating-point control modes are always the default ones and that floating-point status flags are never tested or modified. In practice, few current compilers support the #pragma
explicitly, but most compilers allow meaningful access to the floating-point environment anyway.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.
Contenido |
[editar] Tipos
Definido en la cabecera
<cfenv> | |
fenv_t | El tipo de representación de la totalidad de punto flotante ambiente
Original: The type representing the entire floating-point environment The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
fexcept_t | El tipo de representación de todos los indicadores de estado de coma flotante de forma colectiva
Original: The type representing all floating-point status flags collectively The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar] Funciones
(C++11) |
borra los especificados en coma flotante indicadores de estado Original: clears the specified floating-point status flags The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
(C++11) |
determina cuál de los indicadores de estado de punto flotante especificado se establecen Original: determines which of the specified floating-point status flags are set The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
(C++11) |
eleva los especificados excepciones de punto flotante Original: raises the specified floating-point exceptions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
(C++11)(C++11) |
copia el estado de los indicadores de estado de punto flotante especificado desde o hacia el entorno de punto flotante Original: copies the state of the specified floating-point status flags from or to the floating-point environment The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
(C++11)(C++11) |
obtiene o establece la dirección redondeo Original: gets or sets rounding direction The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
(C++11) |
guarda o restaura el entorno actual de punto flotante Original: saves or restores the current floating point environment The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
(C++11) |
protege el medio ambiente, se borran todos los indicadores de estado y hace caso omiso de todos los errores en el futuro Original: saves the environment, clears all status flags and ignores all future errors The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
(C++11) |
restaura el entorno de coma flotante y plantea la anteriormente lanzar excepciones Original: restores the floating-point environment and raises the previously raise exceptions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
[editar] Macros
excepciones de punto flotante Original: floating-point exceptions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (macro de constante) | |
de punto flotante de redondeo dirección Original: floating-point rounding direction The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (macro de constante) | |
(C++11) |
defecto de punto flotante de medio ambiente Original: default floating-point environment The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (macro de constante) |
[editar] Notas
Las excepciones de punto flotante no están relacionados con las excepciones de C + +. Cuando una operación de punto flotante plantea una excepción de punto flotante, el estado de los cambios en el entorno de coma flotante, que se pueden ensayar con std::fetestexcept, pero la ejecución de un programa en C + + en la mayoría de las implementaciones continúa sin interrupción .
Original:
The floating-point exceptions are not related to the C++ exceptions. When a floating-point operation raises a floating-point exception, the status of the floating-point environment changes, which can be tested with std::fetestexcept, but the execution of a C++ program on most implementations continues uninterrupted.
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.
Hay extensiones compilador que se pueden utilizar para generar C + + excepciones automáticamente siempre que una excepción de punto flotante se eleva:
Original:
There are compiler extensions that may be used to generate C++ exceptions automatically whenever a floating-point exception is raised:
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.
- GNU libc
feenableexcept()
función permite captura de las excepciones de punto flotante, lo que genera la señalSIGFPE
. Si la opción del compilador-fnon-call-exceptions
se utilizó el manejador para esta señal puede lanzar una definida por el usuario C + + excepción .Original:GNU libc functionfeenableexcept()
enables trapping of the floating-point exceptions, which generates the signalSIGFPE
. If the compiler option-fnon-call-exceptions
was used, the handler for that signal may throw a user-defined C++ exception.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Microsoft
_control87()
función WinAPI permite la captura de las excepciones de punto flotante, lo que genera una excepción de hardware, que se puede convertir en C + + excepciones con_set_se_translator
.Original:Microsoft WinAPI function_control87()
enables trapping of the floating-point exceptions, which generates a hardware exception, which can be converted to C++ exceptions with_set_se_translator
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.