C Library –


C Library – <fenv.h>



”;


The fenv.h header file is part of the standard C library, defines various functions and macros for manipulating the floating-point environment. It allows us to control aspects related to floating-point arithmetic, like exception handling and rounding modes.

C − fenv.h Types

Following are the types defined in the header fenv.h





Sr.No. Types & Description
1

fenv_t

This type represents the entire floating-point environment.

2

fexcept_t

This type represents all floating-point status flags collectively.

Library Functions

Following are the functions defined in the header fenv.h














Sr.No. Function & Description
1
int feclearexcept( int excepts )

This function clears the specified floating-point status flags.

2
int fetestexcept( int excepts )

This function determines which of the specified floating-point status flags are set.

3
int feraiseexcept(int excepts)

This function raises the specified floating-point exceptions.

4
int fegetexceptflag( fexcept_t* flagp, int excepts )

This function retrieves the full contents of the floating-point exception flags.

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

This function sets the contents of the floating-point exception flags.

6
int fegetround()

This function retrieves the rounding direction.

7
int fesetround( int round )

This function sets the rounding direction.

8
int fegetenv( fenv_t* envp )

This function attempts to store the status of the floating-point environment in the object pointed to by envp.

9
int fesetenv( const fenv_t* envp )

This function attempts to establish the floating-point environment from the object pointed to by envp.

10
int feholdexcept( fenv_t* envp )

This function saves the environment, clears all status flags and ignores all future errors.

11
int feupdateenv( const fenv_t* envp )

This function restores the floating-point environment and raises the previously raise exceptions.

Advertisements

”;

Leave a Reply

Your email address will not be published. Required fields are marked *