man.bsd.lv manual page server

Manual Page Search Parameters

FPGETMASK(3) Library Functions Manual FPGETMASK(3)

fpgetmask, fpgetprec, fpgetround, fpgetsticky, fpsetmask, fpsetprec, fpsetround, fpsetstickyIEEE FP mode control

library “libc”

#include <ieeefp.h>

fp_except_t
fpgetmask(void);

fp_prec_t
fpgetprec(void);

fp_rnd_t
fpgetround(void);

fp_except_t
fpgetsticky(void);

fp_except_t
fpsetmask(fp_except_t mask);

fp_prec_t
fpsetprec(fp_prec_t prec);

fp_rnd_t
fpsetround(fp_rnd_t rnd_dir);

fp_except_t
fpsetsticky(fp_except_t sticky);

A rounding mode fp_rnd_t is one of:
rounding towards
rounding down to ()
rounding to
rounding down to ()
The default mode is FP_RN.

An fp_except_t value is a bitmask specifying an exception type and containing any of the values listed below.

Invalid Operation
Division by zero
Overflow
Underflow
Imprecision (inexact)
Integer Overflow

An fp_prec_t specifies the precision of the floating point operations listed below.

reserved

The () function will set the current exception mask, i.e., it will cause future operations with the specified result status to raise the SIGFPE exception. The () function will return the current exception mask.

The () function will return the current floating point precision. The () function will set the floating point precision and will return the previous precision.

The () function will cause future operations to use the specified dynamic rounding mode. The () function will return the current rounding mode.

:
On some architectures, instructions can optionally specify static rounding modes and exception enables that will supersede the specified dynamic mode. On other architectures, these features may not be fully supported.

A “sticky” status word may be maintained in which a bit is set every time an exceptional floating point condition is encountered, whether or not a SIGFPE is generated. The () function will set or clear the specified exception history bits. The () function will return the exception history bits.

The fpgetround() and fpsetround() functions return the (previous) rounding mode. The fpgetmask(), fpsetmask(), fpgetsticky(), and fpsetsticky() functions return the (previous) exception mask and exception history bits.

sigaction(2), fenv(3)

There is no way to return an unsupported value. Not all processors support all the modes. These interfaces are deprecated and the ones in fenv(3) should be used, although the interfaces in fenv(3) don't support getting or setting the precision.

March 26, 2011 NetBSD-9.2