Be more explicit when using boost::math functions

experimental-features-fix
Marius Kintel 2014-03-03 23:37:25 -05:00
parent a6f2b9fa6c
commit aeeeb967e7
3 changed files with 5 additions and 7 deletions

View File

@ -646,11 +646,11 @@ Value builtin_cross(const Context *, const EvalContext *evalctx)
}
double d0 = v0[a].toDouble();
double d1 = v1[a].toDouble();
if (isnan(d0) || isnan(d1)) {
if (boost::math::isnan(d0) || boost::math::isnan(d1)) {
PRINT("WARNING: Invalid value (NaN) in parameter vector for cross()");
return Value();
}
if (isinf(d0) || isinf(d1)) {
if (boost::math::isinf(d0) || boost::math::isinf(d1)) {
PRINT("WARNING: Invalid value (INF) in parameter vector for cross()");
return Value();
}

View File

@ -42,7 +42,7 @@
using namespace boost::assign; // bring 'operator+=()' into scope
#include <boost/math/special_functions/fpclassify.hpp>
using boost::math::isinf;
#define isinf boost::math::isinf
#define F_MINIMUM 0.01

View File

@ -40,8 +40,6 @@
#include <glib.h>
#include <boost/math/special_functions/fpclassify.hpp>
using boost::math::isnan;
using boost::math::isinf;
std::ostream &operator<<(std::ostream &stream, const Filename &filename)
{
@ -646,11 +644,11 @@ void Value::RangeType::normalize() {
}
uint32_t Value::RangeType::nbsteps() const {
if (isnan(step_val) || isinf(begin_val) || (isinf(end_val))) {
if (boost::math::isnan(step_val) || boost::math::isinf(begin_val) || (boost::math::isinf(end_val))) {
return std::numeric_limits<uint32_t>::max();
}
if ((begin_val == end_val) || isinf(step_val)) {
if ((begin_val == end_val) || boost::math::isinf(step_val)) {
return 0;
}