fmax()

Return the maximum of two values.

  #include <math.h>
  
  double fmax(double x, double y);
  
  double fmaxf(float x, float y );
  
  double fmaxl(long double x, long double y);    
Parameter

x

First argument.

y

Second argument.

Remarks

These functions return x if x is greater or equal to y. Otherwise, they return y.

This facility may not be available on configurations of the EWL that run on platforms that do not have floating-point math capabilities.

Listing: Example of fmax() usage

#include <math.h>

#include <stdio.h>

int main(void)

{

double m = 4;

double n = 6;

printf("fmax(%f, %f)=%f.\n",m,n,fmax(m,n));

return 0;

}

Output:

fmax(4.000000, 6.000000) = 6.000000