xref: /freebsd/lib/msun/man/fegetmode.3 (revision d8b6461f8c56237a00ddc32678b3928bf76f5440)
1.\"
2.\" Copyright (c) 2026 Faraz Vahedi <kfv@FreeBSD.org>
3.\"
4.\" SPDX-License-Identifier: BSD-2-Clause
5.\"
6.Dd August 31, 2026
7.Dt FEGETMODE 3
8.Os
9.Sh NAME
10.Nm fegetmode ,
11.Nm fesetmode
12.Nd save and restore floating-point control modes
13.Sh LIBRARY
14.Lb libm
15.Sh SYNOPSIS
16.In fenv.h
17.Fd "#pragma STDC FENV_ACCESS ON"
18.Ft int
19.Fn fegetmode "femode_t *modep"
20.Ft int
21.Fn fesetmode "const femode_t *modep"
22.Sh DESCRIPTION
23The
24.Vt femode_t
25type represents the dynamic floating-point control modes,
26including the rounding direction and, where supported, exception
27masks and other implementation-defined modes.
28.Pp
29The
30.Fn fegetmode
31function stores the current control modes in the object
32pointed to by
33.Fa modep .
34.Pp
35The
36.Fn fesetmode
37function establishes the control modes represented by
38.Fa modep .
39The argument
40.Fa modep
41must point to an object set by a prior call to
42.Fn fegetmode ,
43or equal
44.Dv FE_DFL_MODE .
45.Dv FE_DFL_MODE
46expands to a pointer to the default control modes
47.Po
48installed at program startup
49.Pc .
50.Sh RETURN VALUES
51The
52.Fn fegetmode
53and
54.Fn fesetmode
55functions return 0 if they succeed, and non-zero otherwise;
56however, the present implementation always succeeds.
57.Sh SEE ALSO
58.Xr fenv 3 ,
59.Xr fegetround 3 ,
60.Xr fesetround 3
61.Sh STANDARDS
62The
63.Fn fegetmode
64and
65.Fn fesetmode
66functions conform to
67.St -isoC-2023 .
68.Sh HISTORY
69These routines first appeared in
70.Fx 16.0 .
71