Floating point environment

来自cppreference.com

 
 
 
浮点环境
功能
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
feclearexcept(C99)
fetestexcept(C99)
feraiseexcept(C99)
fegetexceptflag
fesetexceptflag
(C99)
(C99)
fegetround
fesetround
(C99)
(C99)
fegetenv
fesetenv
(C99)
feholdexcept(C99)
feupdateenv(C99)
宏常量
Original:
Macro constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
FE_ALL_EXCEPT
FE_DIVBYZERO
FE_INEXACT
FE_INVALID
FE_OVERFLOW
FE_UNDERFLOW
(C99)
FE_DOWNWARD
FE_TONEAREST
FE_TOWARDZERO
FE_UPWARD
(C99)
FE_DFL_ENV(C99)
 
浮点环境的浮点状态标志的设置和控制方式实现支持。它是本地线程,每个线程都会继承父线程的初始状态,其浮点环境。浮点运算修改浮点状态标志,用于指示异常结果或辅助信息。浮点控制模式的状态会影响一些浮点运算的结果.
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.
浮点环境访问和修改是唯一有意义的 #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.

[编辑] 类型

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.

[编辑] 功能

清除指定的浮点状态标志
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.

(函数) [edit]
(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.

(函数) [edit]
提出了指定的浮点异常
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.

(函数) [edit]
复制或浮点环境指定的浮点状态标志的状态
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.

(函数) [edit]
(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.

(函数) [edit]
保存或恢复当前浮点环境
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.

(函数) [edit]
(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.

(函数) [edit]
(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.

(函数) [edit]

[编辑]

浮点异常
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.

(宏不变) [edit]
浮点舍入方向
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.

(宏不变) [edit]
(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.

(宏不变) [edit]