Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c/fpgetround.3c
Real path: /usr/share/man/man3c/fpgetround.3c
Zurück
'\" te .\" Copyright (c) 1989, AT&T. All rights reserved. .\" Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. .TH fpgetround 3C "29 Dec 1996" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME fpgetround, fpsetround, fpgetmask, fpsetmask, fpgetsticky, fpsetsticky \- IEEE floating-point environment control .SH SYNOPSIS .LP .nf #include <ieeefp.h> \fBfp_rnd\fR \fBfpgetround\fR(\fBvoid\fR); .fi .LP .nf \fBfp_rnd\fR \fBfpsetround\fR(\fBfp_rnd\fR \fIrnd_dir\fR); .fi .LP .nf \fBfp_except\fR \fBfpgetmask\fR(\fBvoid\fR); .fi .LP .nf \fBfp_except\fR \fBfpsetmask\fR(\fBfp_except\fR \fImask\fR); .fi .LP .nf \fBfp_except\fR \fBfpgetsticky\fR(\fBvoid\fR); .fi .LP .nf \fBfp_except\fR \fBfpsetsticky\fR(\fBfp_except\fR \fIsticky\fR); .fi .SH DESCRIPTION .sp .LP There are five floating-point exceptions: .RS +4 .TP .ie t \(bu .el o divide-by-zero, .RE .RS +4 .TP .ie t \(bu .el o overflow, .RE .RS +4 .TP .ie t \(bu .el o underflow, .RE .RS +4 .TP .ie t \(bu .el o imprecise (inexact) result, and .RE .RS +4 .TP .ie t \(bu .el o invalid operation. .RE .sp .LP When a floating-point exception occurs, the corresponding sticky bit is set (1), and if the mask bit is enabled (1), the trap takes place. These routines let the user change the behavior on occurrence of any of these exceptions, as well as change the rounding mode for floating-point operations. .sp .LP The \fImask\fR argument is formed by the logical OR operation of the following floating-point exception masks: .sp .in +2 .nf FP_X_INV /* invalid operation exception */ FP_X_OFL /* overflow exception */ FP_X_UFL /* underflow exception */ FP_X_DZ /* divide-by-zero exception */ FP_X_IMP /* imprecise (loss of precision) */ .fi .in -2 .sp .sp .LP The following floating-point rounding modes are passed to \fBfpsetround\fR and returned by \fBfpgetround()\fR. .sp .in +2 .nf FP_RN /* round to nearest representative number */ FP_RP /* round to plus infinity */ FP_RM /* round to minus infinity */ FP_RZ /* round to zero (truncate) */ .fi .in -2 .sp .sp .LP The default environment is rounding mode set to nearest (\fBFP_RN\fR) and all traps disabled. .sp .LP The \fBfpsetsticky()\fR function modifies all sticky flags. The \fBfpsetmask()\fR function changes all mask bits. The \fBfpsetmask()\fR function clears the sticky bit corresponding to any exception being enabled. .SH RETURN VALUES .sp .LP The \fBfpgetround()\fR function returns the current rounding mode. .sp .LP The \fBfpsetround()\fR function sets the rounding mode and returns the previous rounding mode. .sp .LP The \fBfpgetmask()\fR function returns the current exception masks. .sp .LP The \fBfpsetmask()\fR function sets the exception masks and returns the previous setting. .sp .LP The \fBfpgetsticky()\fR function returns the current exception sticky flags. .sp .LP The \fBfpsetsticky()\fR function sets (clears) the exception sticky flags and returns the previous setting. .SH USAGE .sp .LP The C programming language requires truncation (round to zero) for floating point to integral conversions. The current rounding mode has no effect on these conversions. .sp .LP The sticky bit must be cleared to recover from the trap and proceed. If the sticky bit is not cleared before the next trap occurs, a wrong exception type may be signaled. .sp .LP Individual bits may be examined using the constants defined in \fB<ieeefp.h>\fR. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ MT-Level MT-Safe .TE .sp .SH SEE ALSO .sp .LP \fBisnand\fR(3C), \fBattributes\fR(7)