summaryrefslogtreecommitdiff
path: root/src/mathc99.cc
blob: 13f4c64a43cbdbde07266537353435ec44dcb7d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "mathc99.h"

#ifdef WIN32
#include <algorithm>

double trunc(double a) {
	return (a >= 0) ? floor(a) : ceil(a);
}

double round(double a) {
	return a < 0 ? ceil(a - 0.5f) : floor(a + 0.5f);
}

float fmin(float a, float b) {
	return std::min(a,b);
}

float fmax(float a, float b) {
	return std::max(a,b);
}

#endif
contact: Jan Huwald // Impressum