'\" t .\" @(#)fesetround.3m 1.4 97/06/25 SMI .TH fesetround 3M "06/25/97" .SH NAME fesetround, fegetround \- control floating point rounding direction modes .SH SYNOPSIS .LP .B cc .RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|." .B -R/opt/SUNWspro/lib -L/opt/SUNWspro/lib -lm9x .RI "[ " "library" " \|.\|.\|. ]" .LP .B #include .LP .BI "int fesetround(int " round ); .LP .BI "int fegetround(void);" .LP .B #include .LP .BI "int fesetround96(int " round ); .LP .BI "int fegetround96(void);" .SH DESCRIPTION .IX "fesetround function" "" "\fLfesetround()\fP function" .IX "fegetround function" "" "\fLfegetround()\fP function" .IX "fesetround96 function" "" "\fLfesetround96()\fP function" .IX "fegetround96 function" "" "\fLfegetround96()\fP function" .LP \f3fesetround(\f2round\f3)\f1 sets the current rounding direction to the direction specified by \f2round\f1, which must be one of the following values (defined in \f3\f1): .LP .RS .PD 0 .TP 20 \s-1FE_TONEAREST\s0 round to nearest .TP \s-1FE_UPWARD\s0 round toward positive infinity .TP \s-1FE_DOWNWARD\s0 round toward negative infinity .TP \s-1FE_TOWARDZERO\s0 round toward zero .PD .RE .LP The default direction is \s-1FE_TONEAREST\s0 (unless it is changed by the \f3-fround\f1 compiler flag). .LP \f3fegetround(\|)\f1 returns the current rounding direction. .SH "RETURN VALUES" \f3fesetround\f1 returns a nonzero value if the requested rounding mode is established and returns zero otherwise. .SH ATTRIBUTES See .BR attributes (5) for descriptions of the following attributes: .sp .ne 10 .TS box; cbp-1 | cbp-1 l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE = Availability SPROm9xs Interface Stability Stable (see below) MT-Level MT-Safe .TE .LP The \f3fegetround\f1 and \f3fesetround\f1 functions are defined by the C9X draft standard. Should the final standard change the definitions of these functions, new conforming implementations will be provided in a subsequent major release. Therefore, these functions should currently be considered Evolving. .LP To maintain compatibility with the present C9X definitions, programs may instead use the \f3fegetround96\f1 and \f3fesetround96\f1 functions. Each of these functions performs the same operation as its counterpart without the \f396\f1 suffix. The suffixed functions, however, will retain their present definitions regardless of changes to the C9X draft. These functions are Stable. .LP Note that \f3\f1 currently redefines the names of the standard functions to their suffixed counterparts so that compiled programs will invoke the suffixed functions. Once the C9X draft is adopted as a standard, those redefinitions will be removed from \f3\f1. Any program recompiled thereafter that uses the standard, unsuffixed names will then invoke the standard functions (with their final definitions), but previously compiled programs will be unaffected. .SH "SEE ALSO" .BR fegetenv (3M), .BR fesetprec (3M), .BR attributes (5) .LP .I Numerical Computation Guide .SH NOTES As shown in the synopsis, the recommended way to link with libm9x using \f3cc\f1 is to specify .LP .RS .BI -R install-path "/lib -L" install-path "/lib -lm9x" .RE .LP on the command line, where \f2install-path\f1 refers to the location in which the compilers are installed (/opt/SUNWspro by default). See the \f3Numerical Computation Guide\f1 or the READMEs/math_libraries file in the compiler installation area for additional information about linking with libm9x.