fp_read_rnd() — Determine rounding mode

Standards

Standards / Extensions C or C++ Dependencies
 

both

OS/390 V2R6

Format

#define _AIX_COMPATIBILITY 1
#include <float.h>

fprnd_t fp_read_rnd(void);

General description

For an application running in binary floating-point mode, the fp_read_rnd() function returns the current rounding mode indicated by the rounding mode field of the floating-point control (FPC) register. For an application running in hexadecimal floating-point mode, fp_read_rnd() returns 0.

Note: This function will not return or update decimal floating-point rounding mode bits.

Returned value

For an application running in IEEE Binary Floating-Point mode, fp_read_rnd() returns the following:
Value
Rounding Mode
_FP_RND_RZ
Round toward 0
_FP_RND_RN
Round to nearest
_FP_RND_RP
Round toward +infinity
_FP_RND_RM
Round toward -infinity

For an application running in hexadecimal floating-point mode, fp_read_rnd() returns 0.

Related information