1 .\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
2 .TH "FEGETROUND" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
5 fegetround, fesetround \- get and set current rounding direction
13 int fesetround(int\fP \fIround\fP\fB);
18 The \fIfegetround\fP() function shall get the current rounding direction.
20 The \fIfesetround\fP() function shall establish the rounding direction
21 represented by its argument \fIround\fP. If the
22 argument is not equal to the value of a rounding direction macro,
23 the rounding direction is not changed.
26 The \fIfegetround\fP() function shall return the value of the rounding
27 direction macro representing the current rounding
28 direction or a negative value if there is no such rounding direction
29 macro or the current rounding direction is not
32 The \fIfesetround\fP() function shall return a zero value if and only
33 if the requested rounding direction was established.
36 No errors are defined.
38 \fIThe following sections are informative.\fP
41 The following example saves, sets, and restores the rounding direction,
42 reporting an error and aborting if setting the rounding
52 #pragma STDC FENV_ACCESS ON
55 save_round = fegetround();
56 setround_ok = fesetround(round_dir);
57 assert(setround_ok == 0);
59 fesetround(save_round);
76 The Base Definitions volume of IEEE\ Std\ 1003.1-2001, \fI<fenv.h>\fP
78 Portions of this text are reprinted and reproduced in electronic form
79 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
80 -- Portable Operating System Interface (POSIX), The Open Group Base
81 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
82 Electrical and Electronics Engineers, Inc and The Open Group. In the
83 event of any discrepancy between this version and the original IEEE and
84 The Open Group Standard, the original IEEE and The Open Group Standard
85 is the referee document. The original Standard can be obtained online at
86 http://www.opengroup.org/unix/online.html .