Permalink
Browse files

Be more explicit when using boost::math functions

  • Loading branch information...
1 parent a6f2b9f commit aeeeb967e75a5aba82e39f5a1b4c6fb5710bdfc3 @kintel kintel committed Mar 4, 2014
Showing with 5 additions and 7 deletions.
  1. +2 −2 src/func.cc
  2. +1 −1 src/primitives.cc
  3. +2 −4 src/value.cc
View
4 src/func.cc
@@ -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
2 src/primitives.cc
@@ -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
6 src/value.cc
@@ -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;
}

0 comments on commit aeeeb96

Please sign in to comment.