add some more missing C99 math.h functions

stl_dim
meta 2011-01-18 00:52:45 +01:00
parent 5c9ca91c2c
commit 438d5cfbc8
2 changed files with 17 additions and 2 deletions

View File

@ -1,5 +1,18 @@
#include "mathc99.h"
double found(double a) {
return a > 0 ? floor(a+0.5) : ceil(a-0.5);
#ifdef WIN32
#include <algorithm>
double round(double a) {
return a > 0 ? floor(a+0.5) : ceil(a-0.5);
}
float fmin(float a, float b) {
return std::min(a,b);
}
float fmax(float a, float b) {
return std::max(a,b);
}
#endif

View File

@ -6,6 +6,8 @@
#include <cmath>
//for native win32 builds we need to provide C99 math functions by ourselves
double round(double a);
float fmin(float a, float b);
float fmax(float a, float b);
#else