Backport r71704 (add configure check for C99 round function) to trunk.

This commit is contained in:
Mark Dickinson 2009-04-18 14:41:37 +00:00
parent 4beb89b9f7
commit 8e5446f902
5 changed files with 24 additions and 3 deletions

View file

@ -47,6 +47,19 @@ copysign(double x, double y)
}
#endif /* HAVE_COPYSIGN */
#ifndef HAVE_ROUND
double
round(double x)
{
double absx, y;
absx = fabs(x);
y = floor(absx);
if (absx - y >= 0.5)
y += 1.0;
return copysign(y, x);
}
#endif /* HAVE_ROUND */
#ifndef HAVE_LOG1P
#include <float.h>