mirror of https://github.com/vitalif/openscad
add some more missing C99 math.h functions
parent
5c9ca91c2c
commit
438d5cfbc8
|
@ -1,5 +1,18 @@
|
||||||
#include "mathc99.h"
|
#include "mathc99.h"
|
||||||
|
|
||||||
double found(double a) {
|
#ifdef WIN32
|
||||||
return a > 0 ? floor(a+0.5) : ceil(a-0.5);
|
#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
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
//for native win32 builds we need to provide C99 math functions by ourselves
|
//for native win32 builds we need to provide C99 math functions by ourselves
|
||||||
double round(double a);
|
double round(double a);
|
||||||
|
float fmin(float a, float b);
|
||||||
|
float fmax(float a, float b);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue