1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
|
.\" Copyright (c) 2000 Andries Brouwer (aeb@cwi.nl)
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.\"
.\" 2000-08-14 added GNU additions from Andreas Jaeger
.\" 2000-12-05 some changes inspired by acahalan's remarks
.\"
.\" Japanese Version Copyright (c) 2000-2001 NAKANO Takeo all rights reserved.
.\" Translated 2001-02-08, NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\" Updated 2003-10-15, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\"
.\"WORD: (floating point) exception (ư) 㳰
.\"WORD: rounding ݤ
.\"WORD: opaque
.\"
.TH FENV 3 2000-08-12 "Linux Manpage" "Linux Programmer's Manual"
.SH ̾
feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag,
fetestexcept, fegetenv, fegetround, feholdexcept, fesetround,
fesetenv, feupdateenv - C99 ưδݤ㳰μ갷
.SH
.nf
.B #include <fenv.h>
.sp
.BI "int feclearexcept(int " excepts );
.br
.BI "int fegetexceptflag(fexcept_t *" flagp ", int " excepts );
.br
.BI "int feraiseexcept(int " excepts );
.br
.BI "int fesetexceptflag(const fexcept_t *" flagp ", int " excepts );
.br
.BI "int fetestexcept(int " excepts );
.sp
.B "int fegetround(void);"
.br
.BI "int fesetround(int " rounding_mode );
.sp
.BI "int fegetenv(fenv_t *" envp );
.br
.BI "int feholdexcept(fenv_t *" envp );
.br
.BI "int fesetenv(const fenv_t *" envp );
.br
.BI "int feupdateenv(const fenv_t *" envp );
.fi
.SH
11 Ĥδؿ C99 Ƥꡢ
ưδݤ㳰 (Сեˤʤ)
μ갷ꤹ롣
.SS 㳰
DivideByZero 㳰ϡͭ¤οͤФ黻
̵褦ʾ˵롣
.LP
Overflow 㳰ϡ
̤ưͤɽʤФʤʤΤˡ
ͤɽǽư (ͭ¤) ͤ
(ä) 礭ʤäƤޤ褦ʾ˵롣
.LP
Underflow 㳰ϡ
̤ưͤɽʤФʤʤΤˡ
ͤưκǾͤ
ʤäƤޤ
( ɽ٤äƤޤ)
褦ʾ˵롣
.LP
Inexact 㳰ϡݤα黻̤
̵٤η̤Ȱۤʤ褦ʾ˵롣
Overflow ޤ Underflow Ȥˤϡˤ㳰ⵯ롣
.LP
Invalid 㳰ϡ黻̤ޤǤʤ̤褦ʾ˵롣
㤨 0/0-硢sqrt(\-1) ʤɡ
.SS 㳰
㳰ɽˤ 2 Ĥˡ롣
ҤȤĤϡñΥӥåȤ (㳰äʤä) ɽˡǡ
ΥӥåȤΤӥåȰ֤бӥåȤбդ
¸Ǥ롣⤦Ĥϡ¤ΤȤäɽˡǡ
ˡ㳰˴ؤ¿ξ
(㤨㳰äɤΥɥ쥹ʤ) ޤޤ롣
.LP
.BR FE_DIVBYZERO ,
.BR FE_INEXACT ,
.BR FE_INVALID ,
.BR FE_OVERFLOW ,
.B FE_UNDERFLOW
γƥޥϡ줾б㳰ν
ݡȤƤ롣
ΤȤбӥåȤ줾뤳ȤˤʤΤǡ
㳰ؿθƤӽФ㤨
.BR FE_OVERFLOW | FE_UNDERFLOW
ȤΰѤƹԤȤǤ롣
¾㳰⥵ݡȤƤ뤫⤷ʤ
.B FE_ALL_EXCEPT
ޥϡݡȤƤ㳰бӥåȤƥåȤƤ
(ݡȤƤ㳰Ƥ¤Ǥ)
.PP
.B feclearexcept
ؿϡ
.I excepts
Υӥåǻꤵ줿㳰ꥢ
(ϼǥݡȤƤ㳰ˤĤƤΤ߹Ԥ)
.LP
.B fegetexceptflag
ؿϡ
.I excepts
ǻꤵ줿㳰ե饰ξ֤
.RI * flagp
ؤ֥Ȥ¸롣
.LP
.B feraiseexcept
ؿϡ
.I excepts
Υӥåǻꤵ줿㳰Τ
ݡȤƤΤȯ롣
.LP
.B fesetexceptflag
ؿϡ
.I excepts
ǻꤵ줿㳰бե饰ξ֤
.RI * flagp
ͤꤹ롣
.RI * flagp
ͤϡδؿƤ
.B fegetexceptflag
ؿƤӽФƼƤʤФʤʤ
(ΤȤ
.B fegetexceptflag
κǸΰˤϡ
.B fesetexceptflag
Ϥ
.I excepts
Τ٤ƤΥӥåȤޤͤꤹ뤳)
.LP
.B fetestexcept
ؿϡ
.I excepts
ǥåȤƤӥåȤΤ
ꤵƤ㳰бӥåȤ 1 ˤʤäɤ֤
.SS ݤ
.BR FE_DOWNWARD ,
.BR FE_TONEAREST ,
.BR FE_TOWARDZERO ,
.B FE_UPWARD
γƥޥϡ줾бݤ
ݡȤƤ롣
.LP
.B fegetround
ؿϸߤδݤ⡼ɤбޥ֤
.LP
.B fesetround
ؿϴݤ⡼ɤͿ줿ͤˤ
饼֤
.SS ưϢδĶ
ưϢδĶΤϡ
⡼ɤ֥ե饰ޤᡢ
.I fenv_t
֥ȰĤǼ갷ȤǤ롣
ǥեȤδĶϡ
.RI ( "const fenv_t *"
)
.B FE_DFL_ENV
ǼΤǤ롣
ϥץγϻ˹ۤĶǤꡢ
ISO C Ǥϡݤ⡼ɤǤᤤͤؤδݤ
.RB ( FE_TONEAREST )
ꤷ٤Ƥ㳰ꥢ (non-stop)
(㳰Ƥ³) ⡼ɤȤ褦˵ꤵƤ롣
.LP
.B fegetenv
ؿϡߤưĶ֥
.RI * envp
¸롣
.LP
.B feholdexcept
ؿƱưԤ
˲ǽǤСƤ㳰ե饰ꥢ
non-stop (㳰ˤ¹Ԥ³) ⡼ɤꤹ롣
.LP
.B fesetenv
ؿϡưĶ֥
.RI * envp
Ф᤹ͤ
Υ֥ȤϡͭǤ뤳Ȥˤ狼äƤʤФʤʤ
㤨С
.B fegetenv
.B feholdexcept
ƤӽФ̤ǤȤ
.B FE_DFL_ENV
ȤǤʤФʤʤ
δؿθƤӽФ㳰ȯʤ
.LP
.B feupdateenv
ؿϡ֥
.RI * envp
ɽưĶȡ뤹롣
ȯƤ㳰ϥꥢʤ
δؿƤΩäƤ㳰ϡ
ؿƤͤ
.RI * envp
ͤȤΥӥåȤȤ OR äΤˤʤ롣
嵭Ʊͤˡ֥
.RI * envp
ϡͭǤ뤳Ȥ狼äƤʤФʤʤ
.SH ֤
δؿϡξ 0 ֤顼ȯ 0 ʳ֤
.\" ϡδؿΤ 7Ĥ void ֤ΤȽƤ
.\" C99 ɸ Corrigendum 1 (ISO/IEC 9899:1999/Cor.1:2001(E))
.\" ǽ줿
.SH "GNU ξܺ"
ǽʾˤϡGNU C Library ϥޥ
.B FE_NOMASK_ENV
롣ΥޥϤ٤Ƥ㳰ǥȥåפ褦ʴĶɽ
.B #ifdef
ȤäƤΥޥƥȤǤ롣
.B _GNU_SOURCE
Ƥ˸¤ä롣
C99 ɸưޥ (㤨Υե饰ǤΥȥåפʤ)
γƥӥåȤˡˤĤƤƤʤ
glibc 2.2
.I feenableexcept
ؿ
.I fedisableexcept
ؿݡȤƤꡢ
ơưȥåפǤ褦ˤʤäƤ롣
ޤ
.I fegetexcept
ˤäƾ֤䤤碌Ǥ褦ˤʤäƤ롣
.sp
.nf
.B "#define _GNU_SOURCE"
.br
.B "#include <fenv.h>"
.sp
.BI "int feenableexcept (int " excepts );
.br
.BI "int fedisableexcept (int " excepts );
.br
.BI "int fegetexcept (void);"
.br
.fi
.LP
.B feenebleexcept
ؿ
.B fedisableexcept
ؿ
.I excepts
ˤäɽ㳰Υȥåפͭ (̵) ˤ롣
ľͭˤʤäƤ㳰ΥåȤ֤
Ԥ \-1 ֤
.B fegetexcept
ؿϸͭˤʤäƤ㳰Ƥʤ륻åȤ֤
.SH
.B \-lm
ץĤƥ뤳ȡ
.SH
IEC 60559 (IEC 559:1989), ANSI/IEEE 854, ISO C99 (ISO/IEC 9899:1999).
|