xref: /freebsd-src/lib/msun/man/fegetround.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
107235cc8SDavid Schultz.\" Copyright (c) 2004 David Schultz <das@FreeBSD.org>
207235cc8SDavid Schultz.\" All rights reserved.
307235cc8SDavid Schultz.\"
407235cc8SDavid Schultz.\" Redistribution and use in source and binary forms, with or without
507235cc8SDavid Schultz.\" modification, are permitted provided that the following conditions
607235cc8SDavid Schultz.\" are met:
707235cc8SDavid Schultz.\" 1. Redistributions of source code must retain the above copyright
807235cc8SDavid Schultz.\"    notice, this list of conditions and the following disclaimer.
907235cc8SDavid Schultz.\" 2. Redistributions in binary form must reproduce the above copyright
1007235cc8SDavid Schultz.\"    notice, this list of conditions and the following disclaimer in the
1107235cc8SDavid Schultz.\"    documentation and/or other materials provided with the distribution.
1207235cc8SDavid Schultz.\"
1307235cc8SDavid Schultz.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1407235cc8SDavid Schultz.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1507235cc8SDavid Schultz.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1607235cc8SDavid Schultz.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1707235cc8SDavid Schultz.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1807235cc8SDavid Schultz.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1907235cc8SDavid Schultz.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2007235cc8SDavid Schultz.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2107235cc8SDavid Schultz.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2207235cc8SDavid Schultz.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2307235cc8SDavid Schultz.\" SUCH DAMAGE.
2407235cc8SDavid Schultz.\"
2507235cc8SDavid Schultz.Dd May 8, 2004
2607235cc8SDavid Schultz.Dt FEGETROUND 3
2707235cc8SDavid Schultz.Os
2807235cc8SDavid Schultz.Sh NAME
2907235cc8SDavid Schultz.Nm fegetround ,
3007235cc8SDavid Schultz.Nm fesetround
3107235cc8SDavid Schultz.Nd floating-point rounding control
3207235cc8SDavid Schultz.Sh LIBRARY
3307235cc8SDavid Schultz.Lb libm
3407235cc8SDavid Schultz.Sh SYNOPSIS
3507235cc8SDavid Schultz.In fenv.h
3607235cc8SDavid Schultz.Fd "#pragma STDC FENV_ACCESS ON"
3707235cc8SDavid Schultz.Ft int
38*e880667bSRuslan Ermilov.Fn fegetround void
3907235cc8SDavid Schultz.Ft int
4007235cc8SDavid Schultz.Fn fesetround "int round"
4107235cc8SDavid Schultz.Sh DESCRIPTION
4207235cc8SDavid SchultzThe
4307235cc8SDavid Schultz.Fn fegetround
4407235cc8SDavid Schultzfunction determines the current floating-point rounding mode,
4507235cc8SDavid Schultzand the
4607235cc8SDavid Schultz.Fn fesetround
4707235cc8SDavid Schultzfunction sets the current rounding mode to
4807235cc8SDavid Schultz.Fa round .
4907235cc8SDavid SchultzThe rounding mode is one of
50*e880667bSRuslan Ermilov.Dv FE_TONEAREST , FE_DOWNWARD , FE_UPWARD ,
5107235cc8SDavid Schultzor
5207235cc8SDavid Schultz.Dv FE_TOWARDZERO ,
5307235cc8SDavid Schultzas described in
5407235cc8SDavid Schultz.Xr fenv 3 .
5507235cc8SDavid Schultz.Sh RETURN VALUES
5607235cc8SDavid SchultzThe
5707235cc8SDavid Schultz.Fn fegetround
5807235cc8SDavid Schultzroutine returns the current rounding mode.
5907235cc8SDavid SchultzThe
6007235cc8SDavid Schultz.Fn fesetround
6107235cc8SDavid Schultzfunction returns 0 on success and non-zero otherwise;
6207235cc8SDavid Schultzhowever, the present implementation always succeeds.
6307235cc8SDavid Schultz.Sh SEE ALSO
6407235cc8SDavid Schultz.Xr fenv 3 ,
6507235cc8SDavid Schultz.Xr fpgetround 3 ,
6607235cc8SDavid Schultz.Xr fpsetround 3
6707235cc8SDavid Schultz.Sh STANDARDS
6807235cc8SDavid SchultzThe
6907235cc8SDavid Schultz.Fn fegetround
7007235cc8SDavid Schultzand
7107235cc8SDavid Schultz.Fn fesetround
7207235cc8SDavid Schultzfunctions conform to
7307235cc8SDavid Schultz.St -isoC-99 .
7407235cc8SDavid Schultz.Sh HISTORY
7507235cc8SDavid SchultzThese routines first appeared in
7607235cc8SDavid Schultz.Fx 5.3 .
7707235cc8SDavid SchultzThey supersede the non-standard
7807235cc8SDavid Schultz.Xr fpgetround 3
7907235cc8SDavid Schultzand
8007235cc8SDavid Schultz.Xr fpsetround 3
8107235cc8SDavid Schultzfunctions.
82