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.
[编辑] 类型
| Defined in header
<fenv.h> | |
| 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. |
[编辑] 功能
| (C99) |
清除指定的浮点状态标志 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. (函数) |
| (C99) |
确定哪些指定浮点状态标志被设置 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. (函数) |
| (C99) |
提出了指定的浮点异常 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. (函数) |
| (C99) (C99) |
复制或浮点环境指定的浮点状态标志的状态 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. (函数) |
| (C99) (C99) |
获取或设置舍入的方向 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. (函数) |
| (C99) |
保存或恢复当前浮点环境 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. (函数) |
| (C99) |
保存环境,清除所有状态标志,而忽略了未来所有的错误 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. (函数) |
| (C99) |
浮点环境恢复和提高了先前抛出异常 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. (宏不变) | |
| (C99) |
默认的浮点环境 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. (宏不变) |
| 本节是不完整的 原因: FENV_ACCESS |