1 .\" $OpenBSD: fegetround.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 $
23 .Nd control floating-point rounding direction modes
29 .Fn fesetround "int round"
31 These functions provide control of floating-point rounding direction
35 input argument is a value specifying a rounding direction mode and
36 containing any of the values listed below.
37 .Bl -tag -width ".Dv FE_TOWARDZERO"
39 Results are rounded to the closest representable value.
40 If the exact result is exactly half way between two representable
41 values, the value whose last binary digit is even (zero) is chosen.
42 This is the default mode.
44 Results are rounded towards negative \*[If].
46 Results are rounded towards positive \*[If].
48 Results are rounded towards zero.
53 function gets the current rounding direction.
57 function establishes the rounding direction represented by
59 If the argument is not equal to the value of a rounding direction
60 macro, the rounding direction is not changed.
64 function returns the current rounding direction.
67 function return zero on success, and non-zero if an error occurred.
70 .Xr feenableexcept 3 ,
80 These functions first appeared in