* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
-#include "gromacs/math/utilities.h"
+#include "gmxpre.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "utilities.h"
-#include <math.h>
+#include "config.h"
+
+#include <assert.h>
#include <limits.h>
+#include <math.h>
+
#ifdef HAVE__FINITE
#include <float.h>
#endif
-#include <assert.h>
int gmx_nint(real a)
{
{
if (x < 0)
{
- return (-pow(-x, 1.0/DIM));
+ return (-pow(-x, 1.0/3.0));
}
else
{
- return (pow(x, 1.0/DIM));
+ return (pow(x, 1.0/3.0));
}
}
gmx_bool gmx_isfinite(real gmx_unused x)
{
- gmx_bool returnval = TRUE;
- /* If no suitable function was found, assume the value is
- * finite. */
+ gmx_bool returnval;
#ifdef HAVE__FINITE
returnval = _finite(x);
returnval = isfinite(x);
#elif defined HAVE__ISFINITE
returnval = _isfinite(x);
+#else
+ /* If no suitable function was found, assume the value is
+ * finite. */
+ returnval = TRUE;
#endif
return returnval;
}
gmx_bool gmx_isnan(real x)
{
- /* cppcheck-suppress duplicateExpression */
return x != x;
}