diff options
Diffstat (limited to 'src/value.cc')
-rw-r--r-- | src/value.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/value.cc b/src/value.cc index c8a88c6..3a6540f 100644 --- a/src/value.cc +++ b/src/value.cc @@ -39,6 +39,10 @@ /*Unicode support for string lengths and array accesses*/ #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) { fs::path fnpath = fs::path( (std::string)filename ); @@ -642,7 +646,11 @@ void Value::RangeType::normalize() { } uint32_t Value::RangeType::nbsteps() const { - if (begin_val == end_val) { + if (isnan(step_val) || isinf(begin_val) || (isinf(end_val))) { + return std::numeric_limits<uint32_t>::max(); + } + + if ((begin_val == end_val) || isinf(step_val)) { return 0; } |