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