1 .\" Copyright (c) 2004 David Schultz <das@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" $FreeBSD: src/lib/msun/man/feclearexcept.3,v 1.3 2005/01/14 09:12:05 ru Exp $
36 .Nd floating-point exception flag manipulation
41 .Fd "#pragma STDC FENV_ACCESS ON"
43 .Fn feclearexcept "int excepts"
45 .Fn fegetexceptflag "fexcept_t *flagp" "int excepts"
47 .Fn feraiseexcept "int excepts"
49 .Fn fesetexceptflag "const fexcept_t *flagp" "int excepts"
51 .Fn fetestexcept "int excepts"
55 routine clears the floating-point exception flags specified by
59 raises the specified exceptions.
60 Raising an exception causes the corresponding flag to be set,
63 is delivered to the process if the exception is unmasked.
67 function determines which flags are currently set, of those specified by
72 function stores the state of the exception flags specified in
74 in the opaque object pointed to by
78 changes the specified exception flags to reflect the state stored in
79 the object pointed to by
81 Note that the flags restored with
83 must be a (not necessarily proper) subset of the flags recorded by
87 For all of these functions, the possible types of exceptions
88 include those described in
90 Some architectures may define other types of floating-point exceptions.
91 .Sh IMPLEMENTATION NOTES
92 On some architectures, raising an overflow or underflow exception
93 also causes an inexact exception to be raised.
94 In these cases, the overflow or underflow will be raised first.
100 routines are preferred to
104 respectively, for saving and restoring exception flags.
105 The latter do not re-raise exceptions and may preserve
106 architecture-specific information such as addresses where
111 .Fn fegetexceptflag ,
115 functions return 0 upon success, and non-zero otherwise.
118 function returns the bitwise OR of the values of the current exception
119 flags that were requested.
130 .Fn fegetexceptflag ,
132 .Fn fesetexceptflag ,
138 These functions first appeared in