1 .\" $OpenBSD: fegetenv.3,v 1.3 2013/06/05 03:40:26 tedu Exp $
3 .\" Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: June 5 2013 $
25 .Nd manage floating-point environment
29 .Fn fegetenv "fenv_t *envp"
31 .Fn feholdexcept "fenv_t *envp"
33 .Fn fesetenv "const fenv_t *envp"
35 .Fn feupdateenv "const fenv_t *envp"
37 These functions manage the floating-point environment -- status
38 flags, rounding direction modes and exception masks -- as one entity.
41 input argument is an object representing the floating-point environment.
44 represents the default floating-point environment -- the one installed
49 function stores the current floating-point environment in the object
55 function saves the current floating-point environment in the object
58 clears the floating-point status flags, and then installs a non-stop
59 (continue on floating-point exceptions) mode for all floating-point
64 function establishes the floating-point environment represented by
65 the object pointed to by
69 shall point to an object set by a call to
77 merely installs the state of the floating-point status flags
78 represented through its argument, and does not raise these
79 floating-point exceptions.
83 function saves the currently raised floating-point exceptions in
84 its automatic storage, installs the floating-point environment
85 represented by the object pointed to by
87 and then raises the saved floating-point exceptions.
90 shall point to an object set by a call to
103 functions return zero on success, and non-zero if an error occurred.
105 .Xr feclearexcept 3 ,
106 .Xr feenableexcept 3 ,