OpenBSD manual page server

Manual Page Search Parameters

FPGETMASK(3) Library Functions Manual FPGETMASK(3)

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

#include <ieeefp.h>

fp_except
fpgetmask(void);

fp_rnd
fpgetround(void);

fp_except
fpgetsticky(void);

fp_except
fpsetmask(fp_except mask);

fp_rnd
fpsetround(fp_rnd rnd_dir);

fp_except
fpsetsticky(fp_except sticky);

A rounding mode is one of FP_RZ, FP_RM, FP_RN, or FP_RP, for rounding towards zero, rounding (Minus infinity) down, rounding to nearest, and rounding (Plus infinity) up. The default mode is FP_RN.

An fp_except 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)
Denormalization (amd64 and i386 only)

The fpsetmask() function will cause future operations with the specified result status to raise the SIGFPE exception. The fpsetround() function will cause future operations to use the specified dynamic mode.

Note:
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.

The fpsetsticky() function will set or clear the specified 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)

September 14, 2015 OpenBSD-current