xref: /netbsd/lib/libm/man/fegetround.3 (revision 7f1183f2)
1*7f1183f2Sjoerg.\"	$NetBSD: fegetround.3,v 1.1 2010/07/31 21:47:53 joerg Exp $
2*7f1183f2Sjoerg.\" Copyright (c) 2004 David Schultz <das@FreeBSD.org>
3*7f1183f2Sjoerg.\" All rights reserved.
4*7f1183f2Sjoerg.\"
5*7f1183f2Sjoerg.\" Redistribution and use in source and binary forms, with or without
6*7f1183f2Sjoerg.\" modification, are permitted provided that the following conditions
7*7f1183f2Sjoerg.\" are met:
8*7f1183f2Sjoerg.\" 1. Redistributions of source code must retain the above copyright
9*7f1183f2Sjoerg.\"    notice, this list of conditions and the following disclaimer.
10*7f1183f2Sjoerg.\" 2. Redistributions in binary form must reproduce the above copyright
11*7f1183f2Sjoerg.\"    notice, this list of conditions and the following disclaimer in the
12*7f1183f2Sjoerg.\"    documentation and/or other materials provided with the distribution.
13*7f1183f2Sjoerg.\"
14*7f1183f2Sjoerg.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*7f1183f2Sjoerg.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*7f1183f2Sjoerg.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*7f1183f2Sjoerg.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*7f1183f2Sjoerg.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*7f1183f2Sjoerg.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*7f1183f2Sjoerg.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*7f1183f2Sjoerg.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*7f1183f2Sjoerg.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*7f1183f2Sjoerg.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*7f1183f2Sjoerg.\" SUCH DAMAGE.
25*7f1183f2Sjoerg.\"
26*7f1183f2Sjoerg.Dd May 8, 2004
27*7f1183f2Sjoerg.Dt FEGETROUND 3
28*7f1183f2Sjoerg.Os
29*7f1183f2Sjoerg.Sh NAME
30*7f1183f2Sjoerg.Nm fegetround ,
31*7f1183f2Sjoerg.Nm fesetround
32*7f1183f2Sjoerg.Nd floating-point rounding control
33*7f1183f2Sjoerg.Sh LIBRARY
34*7f1183f2Sjoerg.Lb libm
35*7f1183f2Sjoerg.Sh SYNOPSIS
36*7f1183f2Sjoerg.In fenv.h
37*7f1183f2Sjoerg.Fd "#pragma STDC FENV_ACCESS ON"
38*7f1183f2Sjoerg.Ft int
39*7f1183f2Sjoerg.Fn fegetround void
40*7f1183f2Sjoerg.Ft int
41*7f1183f2Sjoerg.Fn fesetround "int round"
42*7f1183f2Sjoerg.Sh DESCRIPTION
43*7f1183f2SjoergThe
44*7f1183f2Sjoerg.Fn fegetround
45*7f1183f2Sjoergfunction determines the current floating-point rounding mode,
46*7f1183f2Sjoergand the
47*7f1183f2Sjoerg.Fn fesetround
48*7f1183f2Sjoergfunction sets the current rounding mode to
49*7f1183f2Sjoerg.Fa round .
50*7f1183f2SjoergThe rounding mode is one of
51*7f1183f2Sjoerg.Dv FE_TONEAREST , FE_DOWNWARD , FE_UPWARD ,
52*7f1183f2Sjoergor
53*7f1183f2Sjoerg.Dv FE_TOWARDZERO ,
54*7f1183f2Sjoergas described in
55*7f1183f2Sjoerg.Xr fenv 3 .
56*7f1183f2Sjoerg.Sh RETURN VALUES
57*7f1183f2SjoergThe
58*7f1183f2Sjoerg.Fn fegetround
59*7f1183f2Sjoergroutine returns the current rounding mode.
60*7f1183f2SjoergThe
61*7f1183f2Sjoerg.Fn fesetround
62*7f1183f2Sjoergfunction returns 0 on success and non-zero otherwise;
63*7f1183f2Sjoerghowever, the present implementation always succeeds.
64*7f1183f2Sjoerg.Sh SEE ALSO
65*7f1183f2Sjoerg.Xr fenv 3 ,
66*7f1183f2Sjoerg.Xr fpgetround 3 ,
67*7f1183f2Sjoerg.Xr fpsetround 3
68*7f1183f2Sjoerg.Sh STANDARDS
69*7f1183f2SjoergThe
70*7f1183f2Sjoerg.Fn fegetround
71*7f1183f2Sjoergand
72*7f1183f2Sjoerg.Fn fesetround
73*7f1183f2Sjoergfunctions conform to
74*7f1183f2Sjoerg.St -isoC-99 .
75*7f1183f2Sjoerg.Sh HISTORY
76*7f1183f2SjoergThese routines first appeared in
77*7f1183f2Sjoerg.Fx 5.3
78*7f1183f2Sjoergand
79*7f1183f2Sjoerg.Nx 6.0 .
80*7f1183f2SjoergThey supersede the non-standard
81*7f1183f2Sjoerg.Xr fpgetround 3
82*7f1183f2Sjoergand
83*7f1183f2Sjoerg.Xr fpsetround 3
84*7f1183f2Sjoergfunctions.
85