fmin, fminf, fminl

Visual Studio 2015
 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at fmin, fminf, fminl.

Determines the smaller of the two specified values.

double fmin(  
   double x,   
   double y  
);  
  
float fmin(  
   float x,   
   float y  
); //C++ only  
  
long double fmin(  
   long double x,   
   long double y  
); //C++ only  
  
float fminf(  
   float x,   
   float y  
);  
  
long double fminl(  
   long double x,   
   long double y  
);  
  

Parameters

x
The first value to compare.

y
The second value to compare.

If successful, returns the smaller of x or y.

InputResult
x is NaNy
y is NaNx
x and y are NaNnan

The function does not cause _matherr to be invoked, cause any floating-point exceptions, or change the value of errno.

Because C++ allows overloading, you can call overloads of fmin that take and return float and long double types. In a C program, fmin always takes and returns a double.

RoutineRequired header
fmin, fminf, fminlC: <math.h>

C++: <math.h> or <cmath>

For additional compatibility information, see Compatibility.

Alphabetical Function Reference

Show: