Floating-point environment
提供: cppreference.com
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
浮動小数点環境では、浮動小数点ステータスフラグと実装によってサポートされる制御モードのセットです。それはスレッドローカルで、各スレッドは親スレッドから浮動小数点環境の初期状態を継承します。浮動小数点演算では、異常な結果や補助的な情報を示すために、浮動小数点ステータスフラグを変更します。浮動小数点の制御モードの状態はいくつかの浮動小数点演算の結果に影響を及ぼし.
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
<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. (マクロ定数) |
[編集] ノート
浮動小数点例外は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-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. - マイクロソフトWinAPIの関数
_control87()
は_set_se_translator
とC + +例外に変換することができ、ハードウェア例外を生成し、浮動小数点例外のトラップを有効にします.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.