WSL/SLF GitLab Repository

Commit 898a838c authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Another fix for issue 144: fallback "round" function for Visual C++ (that...

Another fix for issue 144: fallback "round" function for Visual C++ (that still does not conform to C99... only 12 years late...)
parent 514fa75f
......@@ -19,6 +19,23 @@
using namespace std;
#ifdef _WIN32
//This is C99, Microsoft should move on and suppport it, it is almost 15 years old!!
double round(const double& x) {
//middle value point test
if (ceil(x+0.5) == floor(x+0.5)) {
const int a = (int)ceil(x);
if (a%2 == 0) {
return ceil(x);
} else {
return floor(x);
}
} else {
return floor(x+0.5);
}
}
#endif
namespace mio {
const int Date::daysLeapYear[12] = {31,29,31,30,31,30,31,31,30,31,30,31};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment