FEGETPREC 3CW "17 April 2006" "mathcw-1.00"

Table of contents


NAME

fegetprec - get the current rounding precision

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <fenvcw.h>

extern int fegetprec (void);


DESCRIPTION

Return the current rounding precision as one of the values FE_FLTPREC, FE_DBLPREC, or FE_LDBLPREC.

NOTES

Rounding precision control is a feature of some implementations of the IEEE 754 floating-point system, such as those on the Motorola 68K and Intel IA-32 and IA-64 architectures, which carry out computations in extended-length registers, by default in the longest available precision. Intermediate results are normally rounded to storage precision only when they are stored to memory. However, when the rounding precision is set to FE_FLTPREC or FE_DBLPREC, rounding is done to the 32-bit or 64-bit storage formats, respectively, after each numeric operation. The AMD AMD64 and Intel EM64T architectures have a mixed floating-point architecture, providing the old-style 80-bit extended precision registers normally used for computations with long double, and 32-bit and 64-bit registers used for computations with float and double. Rounding precision control is only effective for the 80-bit registers.

RETURN VALUES

Return the current rounding precision on success, or a negative value on failure (typically because the host does not support rounding precision control).

ERRORS

None.

SEE ALSO

feclearexcept(3CW), fegetenv(3CW), fegetexceptflag(3CW), fegetround(3CW), feholdexcept(3CW), feraiseexcept(3CW), fesetenv(3CW), fesetexceptflag(3CW), fesetprec(3CW), fesetround(3CW), fetestexcept(3CW), feupdateenv(3CW).