「C言語/標準ライブラリ/fenv.h」の版間の差分
削除された内容 追加された内容
タグ: 2017年版ソースエディター |
→関数: C17 タグ: 2017年版ソースエディター |
||
55 行
=== feclearexcept関数 ===
ISO/IEC 9899:2017 § 7.6.2.1 ''The feclearexcept function''<ref name="jtc1-sc22-wg14-n2596-7.6.2.1">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 152, §7.6.2.1 ''The feclearexcept function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int feclearexcept(int excepts);
</syntaxhighlight>
; 機能
<!--
2 The feclearexcept function attempts to clear the supported floating-point exceptions represented by its argument.
-->
; 返却値
<!--
3 The feclearexcept function returns zero if the excepts argument is zero or if all the specified exceptions were successfully cleared. Otherwise, it returns a nonzero value.
-->
=== fegetexceptflag関数 ===
ISO/IEC 9899:2017 § 7.6.2.2 ''The fegetexceptflag function''<ref name="jtc1-sc22-wg14-n2596-7.6.2.2">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 152, §7.6.2.2 ''The fegetexceptflag function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int fegetexceptflag(fexcept_t *flagp,int excepts);
</syntaxhighlight>
<!--
#pragma STDC FENV_ACCESS ON pragma, and assuming the default state is “off”, just one evaluation of x + 1 would suffice.
set or clear. An implementation may endow floating-point status flags with more information — for example, the address of
the code which first raised the floating-point exception; the functions fegetexceptflag and fesetexceptflag deal with
the full content of flags.
-->
; 機能
<!--
2 The fegetexceptflag function attempts to store an implementation-defined representation of the states of the floating-point status flags indicated by the argument excepts in the object pointed to by the argument flagp.
-->
; 返却値
<!--
3 The fegetexceptflag function returns zero if the representation was successfully stored. Otherwise,it returns a nonzero value.
-->
=== feraiseexcept関数 ===
ISO/IEC 9899:2017 § 7.6.2.3 ''The feraiseexcept function''<ref name="jtc1-sc22-wg14-n2596-7.6.2.3">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 153, §7.6.2.3 ''The feraiseexcept function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int feraiseexcept(int excepts);
</syntaxhighlight>
; 機能
<!--
2 The feraiseexcept function attempts to raise the supported floating-point exceptions represented
by its argument.220) The order in which these floating-point exceptions are raised is unspecified,except as stated in F.8.6. Whether the feraiseexcept function additionally raises the “inexact”
floating-point exception whenever it raises the “overflow” or “underflow” floating-point exception
is implementation-defined.
-->
; 返却値
<!--
3 The feraiseexcept function returns zero if the excepts argument is zero or if all the specified
exceptions were successfully raised. Otherwise, it returns a nonzero value.
-->
=== fesetexceptflag関数 ===
ISO/IEC 9899:2017 § 7.6.2.4 ''The fesetexceptflag function''<ref name="jtc1-sc22-wg14-n2596-7.6.2.4">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 153, §7.6.2.4 ''The fesetexceptflag function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int fesetexceptflag(const fexcept_t *flagp,int excepts);
</syntaxhighlight>
; 機能
<!--
2 The fesetexceptflag function attempts to set the floating-point status flags indicated by the
argument excepts to the states stored in the object pointed to by flagp. The value of *flagp shall
have been set by a previous call to fegetexceptflag whose second argument represented at least
those floating-point exceptions represented by the argument excepts. This function does not raise
floating-point exceptions, but only sets the state of the flags.
-->
; 返却値
<!--
3 The fesetexceptflag function returns zero if the excepts argument is zero or if all the specified
flags were successfully set to the appropriate state. Otherwise, it returns a nonzero value.
-->
=== fetestexcept関数 ===
ISO/IEC 9899:2017 § 7.6.2.5 ''The fetestexcept function''<ref name="jtc1-sc22-wg14-n2596-7.6.2.5">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 153, §7.6.2.5 ''The fetestexcept function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int fetestexcept(int excepts);
</syntaxhighlight>
; 機能
<!--
2 The fetestexcept function determines which of a specified subset of the floating-point exception flags are currently set. The excepts argument specifies the floating-point status flags to be
queried.
traps for floating-point exceptions raised by this function are taken. The specification in F.8.6 is in the same spirit.
-->
; 返却値
<!--
3 The fetestexcept function returns the value of the bitwise OR of the floating-point exception
macros corresponding to the currently set floating-point exceptions included in excepts.
-->
=== 7.6.3 Rounding ===
<!--
1 The fegetround and fesetround functions provide control of rounding direction modes.
-->
=== fegetround関数 ===
ISO/IEC 9899:2017 § 7.6.3.1 ''The fegetround function''<ref name="jtc1-sc22-wg14-n2596-7.6.3.1">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 154, §7.6.3.1 ''The fegetround function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int fegetround(void);
</syntaxhighlight>
; 機能
<!--
2 The fegetround function gets the current rounding direction.
-->
; 返却値
<!--
3 The fegetround function returns the value of the rounding direction macro representing the current
rounding direction or a negative value if there is no such rounding direction macro or the current
rounding direction is not determinable.
-->
=== fesetround関数 ===
ISO/IEC 9899:2017 § 7.6.3.2 ''The fesetround function''<ref name="jtc1-sc22-wg14-n2596-7.6.3.2">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 154, §7.6.3.2 ''The fesetround function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int fesetround(int round);
</syntaxhighlight>
; 機能
<!--
2 The fesetround function establishes the rounding direction represented by its argument round. If
the argument is not equal to the value of a rounding direction macro, the rounding direction is not
changed.
-->
; 返却値
<!--
3 The fesetround function returns zero if and only if the requested rounding direction was established.
-->
=== 7.6.4 Environment ===
<!--
1 The functions in this section manage the floating-point environment — status flags and control
modes — as one entity.
-->
=== fegetenv関数 ===
ISO/IEC 9899:2017 § 7.6.4.1 ''The fegetenv function''<ref name="jtc1-sc22-wg14-n2596-7.6.4.1">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 155, §7.6.4.1 ''The fegetenv function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int fegetenv(fenv_t *envp);
</syntaxhighlight>
; 機能
<!--
2 The fegetenv function attempts to store the current floating-point environment in the object pointed
to by envp.
-->
; 返却値
<!--
3 The fegetenv function returns zero if the environment was successfully stored. Otherwise, it returns
a nonzero value.
-->
=== feholdexcept関数 ===
ISO/IEC 9899:2017 § 7.6.4.2 ''The feholdexcept function''<ref name="jtc1-sc22-wg14-n2596-7.6.4.2">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 155, §7.6.4.2 ''The feholdexcept function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int feholdexcept(fenv_t *envp);
</syntaxhighlight>
; 機能
<!--
2 The feholdexcept function saves the current floating-point environment in the object pointed to by
envp, clears the floating-point status flags, and then installs a non-stop (continue on floating-point
exceptions) mode, if available, for all floating-point exceptions.
-->
; 返却値
<!--
3 The feholdexcept function returns zero if and only if non-stop floating-point exception handling
was successfully installed.
-->
=== fesetenv関数 ===
ISO/IEC 9899:2017 § 7.6.4.3 ''The fesetenv function''<ref name="jtc1-sc22-wg14-n2596-7.6.4.3">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 155, §7.6.4.3 ''The fesetenv function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int fesetenv(const fenv_t *envp);
</syntaxhighlight>
; 機能
<!--
2 The fesetenv function attempts to establish the floating-point environment represented by the
object pointed to by envp. The argument envp shall point to an object set by a call to fegetenv or
feholdexcept, or equal a floating-point environment macro. Note that fesetenv merely installs
the system provides only the non-stop mode then installing it is trivial. For such systems, the feholdexcept function can be
used in conjunction with the feupdateenv function to write routines that hide spurious floating-point exceptions from their
callers.
the state of the floating-point status flags represented through its argument, and does not raise these
floating-point exceptions.
-->
; 返却値
<!--
3 The fesetenv function returns zero if the environment was successfully established. Otherwise, it
returns a nonzero value.
-->
=== feupdateenv関数 ===
ISO/IEC 9899:2017 § 7.6.4.4 ''The feupdateenv function''<ref name="jtc1-sc22-wg14-n2596-7.6.4.4">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 156, §7.6.4.4 ''The feupdateenv function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
#include <fenv.h>
int feupdateenv(const fenv_t *envp);
</syntaxhighlight>
; 機能
<!--
2 The feupdateenv function attempts to save the currently raised floating-point exceptions in its
automatic storage, install the floating-point environment represented by the object pointed to by
envp, and then raise the saved floating-point exceptions. The argument envp shall point to an object
set by a call to feholdexcept or fegetenv, or equal a floating-point environment macro.
-->
; 返却値
<!--
3 The feupdateenv function returns zero if all the actions were successfully carried out. Otherwise, it
returns a nonzero value.
-->
==脚註==
|