Chapter Contents

Previous

Next
fmax

fmax



Find the Maximum of Two Doubles

Portability: SAS/C extension


SYNOPSIS
DESCRIPTION
RETURN VALUE
IMPLEMENTATION
EXAMPLE
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

#include <lcmath.h>

double fmax(double s, double r);


DESCRIPTION

fmax finds the maximum of two double values, s and r .


RETURN VALUE

fmax returns a double value that represents the maximum of the two arguments.


IMPLEMENTATION

fmax is a built-in function.


EXAMPLE

#include <lcmath.h>
#include <stdio.h>

main()
{
   double num1, num2;  /* numbers to be compared            */
   double result;      /* holds the larger of num1 and num2 */

   puts("Enter num1 & num2 : ");
   scanf("%lf %lf", &num1, &num2);

   result = fmax(num1, num2);

   printf("The larger number is %f\n", result);
}


RELATED FUNCTIONS

fmin , max


SEE ALSO


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.