[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

fegetexceptflag or fesetexceptflag Subroutine

Purpose

Gets and sets floating-point status flags.

Syntax

#include <fenv.h>

int fegetexceptflag (flagp, excepts)
feexcept_t *flagp;
int excepts;

int fesetexceptflag (flagp, excepts)
const fexcept_t *flagp;
int excepts;

Description

The fegetexceptflag subroutine attempts to store an implementation-defined representation of the states of the floating-point status flags indicated by the excepts parameter in the object pointed to by the flagp parameter.

The fesetexceptflag subroutine attempts to set the floating-point status flags indicated by the excepts parameter to the states stored in the object pointed to by the flagp parameter. The value pointed to by the flagp parameter shall have been set by a previous call to the fegetexceptflag subroutine whose second argument represented at least those floating-point exceptions represented by the excepts parameter. This subroutine does not raise floating-point exceptions. It only sets the state of the flags.

Parameters

flagp Points to the object that holds the implementation-defined representation of the states of the floating-point status flags.
excepts Points to an implementation-defined representation of the states of the floating-point status flags.

Return Values

If the representation was successfully stored, the fegetexceptflag parameter returns zero. Otherwise, it returns a nonzero value. If the excepts parameter is zero or if all the specified exceptions were successfully set, the fesetexceptflag subroutine returns zero. Otherwise, it returns a nonzero value.

Related Information

feraiseexcept Subroutine and fetestexcept Subroutine.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]