The fminl
function is defined in the <tgmath.h>
header file in C. It takes in two parameters of type long double
: x
and y
. It then returns the smaller of the two numbers.
The illustration below shows how the fminl
function works:
The fminl
function is defined as follows:
long double fminl( long double x, long double y );
The fminl
function takes two values of the long double
type as parameters.
The fminl
function returns the smaller of the two long double
values.
The fminl
function returns special values for certain arguments:
x | y | Returned Value |
---|---|---|
valid long double |
NaN |
x |
NaN |
valid long double |
y |
NaN |
NaN |
Nan |
The following code snippet shows how we can use the fminl
function:
#include <stdio.h> // include header for printf#include <tgmath.h> // include header for fminlint main(){// setting values for x and ylong double x = 2.0;long double y = 4.0;long double result;result = fminl(x, y);printf("The result is: %Lf", result);return 0;}
Free Resources