Floating-point environment
Материал из 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. |
Плавающей точкой окружающей среды является набор чисел с плавающей точкой флаги состояния и режимов управления поддерживается реализацией. Это является поточно-местный, каждый поток наследует начальное состояние своего плавающей точкой окружающей среды от родительского потока. Операции с плавающей запятой изменения плавающей точкой флаги состояния указывает ненормальные результаты или вспомогательной информации. Состоянии с плавающей точкой режимов управления влияет на результаты некоторых операций с плавающей запятой.
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.
Плавающей точкой доступа окружающую среду и изменение имеет смысл только при
#pragma STDC FENV_ACCESS установлен в
ON. В противном случае реализация свободна предположить, что с плавающей точкой режимов управления всегда по умолчанию, и что с плавающей точкой флаги статуса никогда не проверялись или изменены. На практике несколько текущих компиляторы поддерживают #pragma явно, но большинство компиляторов позволяют реальный доступ к плавающей точкой окружающей среды все равно.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.
Содержание |
[править] Типы
| Определено в файле <cfenv>
| |
| fenv_t | Тип представляющая весь плавающей точкой окружающей среды
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 | Типа, представляющие все с плавающей точкой флаги состояния коллективно
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. |
[править] Функции
| (C++11) |
очищает указанный плавающей точкой флаги статуса 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. (функция) |
| (C++11) |
определяет, какая из указанных плавающей точкой флаги состояния устанавливаются 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. (функция) |
| (C++11) |
Возникает указанного плавающей точкой исключений 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. (функция) |
| (C++11) (C++11) |
копирует состояние указанного плавающей точкой состояния флагов или с плавающей точкой окружающей среды 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. (функция) |
| (C++11) (C++11) |
получает или задает направление округления 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. (функция) |
| (C++11) |
сохраняет или восстанавливает текущую плавающей точкой окружающей среды 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. (функция) |
| (C++11) |
сохраняет окружающую среду, очищает все флаги состояния и игнорирует все ошибок в будущем 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. (функция) |
| (C++11) |
Восстанавливает с плавающей точкой окружающей среды и повышает ранее вызывать исключения 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. (функция) |
[править] Макросы
| плавающей точкой исключений 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. (константа-макрос) | |
| плавающей точкой округления направлении 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. (константа-макрос) | |
| (C++11) |
умолчанию с плавающей точкой окружающей среды 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. (константа-макрос) |
[править] Notes
Плавающей точкой исключений не связанные с C + + исключения. При операции с плавающей запятой поднимает с плавающей точкой исключений, статус плавающей точкой изменения окружающей среды, которые могут быть проверены с std::fetestexcept, но исполнение C + + программ на большинстве реализаций не прерывается.
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.
Есть компилятор расширений, которые могут быть использованы для создания C + + исключения автоматически всякий раз, когда с плавающей точкой исключение
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()позволяет захват с плавающей точкой исключений, которые генерирует сигналSIGFPE. Если-fnon-call-exceptionsопции компилятора был использован обработчик для этого сигнала может пролить определенный пользователем C + + исключение.Original:GNU libc functionfeenableexcept()enables trapping of the floating-point exceptions, which generates the signalSIGFPE. If the compiler option-fnon-call-exceptionswas 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 WinAPI функции
_control87()позволяет захват с плавающей точкой исключений, которые генерирует аппаратное исключение, которое может быть преобразовано в C + + исключения с_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.