C++ Math fmax()
The function returns the maximum value between two numbers.
Consider two numbers 'x' and 'y'.
If(x>y): It returns x.
Note: If any argument has an integral type, then it is cast to double. If any other argument is long double, then it is cast to long double.
(x,y): Values among which the maximum value is calculated.
It returns the maximum value between two numbers.
Let's see a simple example.
Values of x and y are :3.3,6.9 Maximum value is :6.9
In this example, value of y is greater than the value of x. Therefore, fmax() function returns the value of y.
Let's see a simple example when one of the value is nan.
Values of x and y are :1.3,nan Maximum value is :1.3
In this example, value of y is nan.Therefore, fmax() function returns the value of x.
Next TopicC++ Math Functions
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week