fetestexcept

Defined in header <<fenv.h>> int fetestexcept( int excepts ); (since C99) Determines which of the specified subset of the floating point exceptions are currently set. The argument excepts is a bitwise OR of the floating point exception macros. Parameters excepts - bitmask listing the exception flags to test Return value Bitwise OR of the floating-point exception macros that are both included in excepts and correspond to floating-point exceptions currentl

ferror

Defined in header <stdio.h> int ferror( FILE *stream ); Checks the given stream for errors. Parameters stream - the file stream to check Return value Nonzero value if the file stream has errors occurred, ​0​ otherwise. Example #include <stdio.h> #include <stdlib.h> int main(void) { FILE* fp = fopen("test.txt", "r"); if(!fp) { perror("File opening failed"); return EXIT_FAILURE; } int c; // note: int, not char

feraiseexcept

Defined in header <<fenv.h>> int feraiseexcept( int excepts ); (since C99) Attempts to raise all floating point exceptions listed in excepts (a bitwise OR of the floating point exception macros). If one of the exceptions is FE_OVERFLOW or FE_UNDERFLOW, this function may additionally raise FE_INEXACT. The order in which the exceptions are raised is unspecified, except that FE_OVERFLOW and FE_UNDERFLOW are always raised before FE_INEXACT. Parameters excepts - bi

feof

Defined in header <stdio.h> int feof( FILE *stream ); Checks if the end of the given file stream has been reached. Parameters stream - the file stream to check Return value nonzero value if the end of the stream has been reached, otherwise ​0​ Notes This function only reports the stream state as reported by the most recent I/O operation, it does not examine the associated data source. For example, if the most recent I/O was a fgetc, which returned the last

feholdexcept

Defined in header <<fenv.h>> int feholdexcept( fenv_t* envp ); (since C99) First, saves the current floating-point environment to the object pointed to by envp (similar to fegetenv), then clears all floating-point status flags, and then installs the non-stop mode: future floating-point exceptions will not interrupt execution (will not trap), until the floating-point environment is restored by feupdateenv or fesetenv. This function may be used in the beginning of a sub

fegetround

Defined in header <fenv.h> int fesetround( int round ); (1) (since C99) int fegetround(); (2) (since C99) 1) Attempts to establish the floating-point rounding direction equal to the argument argument round, which is expected to be one of the floating point rounding macros. 2) Returns the value of the floating point rounding macro that corresponds to the current rounding direction. Parameters round - rounding direction, one of floating point rounding macros

fegetexceptflag

Defined in header <<fenv.h>> int fegetexceptflag( fexcept_t* flagp, int excepts ); (1) (since C99) int fesetexceptflag( const fexcept_t* flagp, int excepts ); (2) (since C99) 1) Attempts to obtain the full contents of the floating-point exception flags that are listed in the bitmask argument excepts, which is a bitwise OR of the floating point exception macros. 2) Attempts to copy the full contents of the floating-point exception flags that are listed in excepts

fegetenv

Defined in header <<fenv.h>> int fegetenv( fenv_t* envp ); (1) (since C99) int fesetenv( const fenv_t* envp ); (2) (since C99) 1) Attempts to store the status of the floating-point environment in the object pointed to by envp. 2) Attempts to establish the floating-point environment from the object pointed to by envp. The value of that object must be previously obtained by a call to feholdexcept or fegetenv or be a floating-point macro constant. If any of the flo

feclearexcept

Defined in header <<fenv.h>> int feclearexcept( int excepts ); (since C99) Attempts to clear the floating-point exceptions that are listed in the bitmask argument excepts, which is a bitwise OR of the floating point exception macros. Parameters excepts - bitmask listing the exception flags to clear Return value ​0​ if all indicated exceptions were successfully cleared or if excepts is zero. Returns a non-zero value on error. Example #include <fen

fdim

Defined in header <math.h> float fdimf( float x, float y ); (1) (since C99) double fdim( double x, double y ); (2) (since C99) long double fdiml( long double x, long double y ); (3) (since C99) Defined in header <tgmath.h> #define fdim( x, y ) (4) (since C99) 1-3) Returns the positive difference between x and y, that is, if x>y, returns x-y, otherwise (if x≤y), returns +0. 4) Type-generic macro: If any argument has type long do