C/C++: Obtenir la valeur absolue dvec la fonction ‘fabs()’

Author:


Download

#include

#include 

int main(void)
{
float x = 4.0F * atanf( 1.0F );
long double y = 4.0L * atanl( 1.0L );

if ( x == y )
  printf( "x et y sont égaux.n" );
else if ( fabs( x - y ) < 0.0001 * fabsl( y ) )
  printf( "x et y sont approximativement égaux:n"
          "x = %.8f et y = %.8Lf.n", x, y );

  return 0;
}

Leave a Reply

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