Add definition of rint for _WIN32

This commit is contained in:
MarkRivers
2012-10-02 21:09:13 +00:00
parent f28094301d
commit b5ba30d9cd
@@ -34,6 +34,22 @@
#define HOLD_NEVER 0
#define FAR_AWAY 1000000000 /*nm*/
// Windows does not have rint()
#ifdef _WIN32
double rint(double x)
{
//middle value point test
if (ceil(x+0.5) == floor(x+0.5))
{
int a = (int)ceil(x);
if (a%2 == 0) return ceil(x);
else return floor(x);
}
else return floor(x+0.5);
}
#endif
/* The asyn motor driver apparently can't cope with exceptions */
#undef ASYN_CANDO_EXCEPTIONS
/* Define this if exceptions should be thrown and it is OK to abort the application */