HPlogo HP-UX Reference Volume 5 of 5 > f

fenv(5)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

fenv — floating-point environment macros and functions

SYNOPSIS

#include <fenv.h>

DESCRIPTION

The header <fenv.h> declares two types and several macros and functions to provide access to the floating-point environment. The floating-point environment refers collectively to the floating-point status flags and control modes. A floating-point status flag is a system variable whose value is set as a side effect of the arithmetic to provide auxiliary information. A floating-point control mode is a system variable whose value may be set by the user to affect the subsequent behavior of the arithmetic; on HP 9000 systems the control modes include the rounding direction mode, the underflow mode, and the trap enables.

The following types are defined:

fenv_t

Represents the entire floating-point environment.

fexcept_t

Represents the floating-point exception flags collectively.

The following macros represent the floating-point status flags. They are defined as integral constant expressions.

FE_INEXACT

The inexact exception.

FE_DIVBYZERO

The division-by-zero exception.

FE_UNDERFLOW

The underflow exception.

FE_OVERFLOW

The overflow exception.

FE_INVALID

The invalid operation exception.

FE_ALL_EXCEPT

The bitwise OR of all exception macros.

The following macros represent the rounding direction modes. They are defined as integral constant expressions.

FE_TONEAREST

The round-to-nearest rounding direction mode.

FE_UPWARD

The round-toward-positive-infinity rounding direction mode.

FE_DOWNWARD

The round-toward-negative-infinity rounding direction mode.

FE_TOWARDZERO

The round-toward-zero rounding direction mode.

The following macro is defined as a pointer to const-qualified fenv_t:

FE_DFL_ENV

The default floating-point environment.

The <fenv.h> header file and its contents have been approved for inclusion in the C9X standard. The HP implementation adds four HP-specific functions to the approved contents: fegetflushtozero(), fesetflushtozero(), fegettrapenable(), and fesettrapenable().

FILES

/usr/include/fenv.h

© Hewlett-Packard Development Company, L.P.