getPowerDeriv: workaround for MS Visual Studio

issue#70
Sébastien Villemot 2010-12-22 13:50:13 +01:00
parent 94f82b312b
commit 1428fcb9f8
1 changed files with 3 additions and 0 deletions

View File

@ -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