From 1428fcb9f8725185ce85b8bb39b88059d424919f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Wed, 22 Dec 2010 13:50:13 +0100 Subject: [PATCH] getPowerDeriv: workaround for MS Visual Studio --- DataTree.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DataTree.cc b/DataTree.cc index f151fa3a..6b30f1eb 100644 --- a/DataTree.cc +++ b/DataTree.cc @@ -634,6 +634,9 @@ DataTree::writePowerDeriv(ostream &output, bool use_dll) const << " */" << endl << "double getPowerDeriv(double x, double p, int k)" << endl << "{" << endl + << "#ifdef _MSC_VER" << endl + << "# define nearbyint(x) (fabs((x)-floor(x)) < fabs((x)-ceil(x)) ? floor(x) : ceil(x))" << endl + << "#endif" << endl << " if ( fabs(x) < " << NEAR_ZERO << " && p > 0 && k >= p && fabs(p-nearbyint(p)) < " << NEAR_ZERO << " )" << endl << " return 0.0;" << endl << " else" << endl