Add an implementation of fmax for use with MSVC

This commit is contained in:
Jeff Muizelaar 2011-03-03 16:34:43 -05:00
parent aca492eb3f
commit de2c5bfa19

View file

@ -227,6 +227,20 @@ ffs (int x)
return 0;
}
#define _USE_MATH_DEFINES
#include <float.h>
static inline double
fmax (double a, double b)
{
if (_isnan(a))
return b;
if (_isnan(b))
return a;
return a > b ? a : b;
}
#endif
#if defined(_MSC_VER) && defined(_M_IX86)