mirror of
https://github.com/ArashPartow/exprtk.git
synced 2025-06-12 16:27:23 +00:00
C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html
This commit is contained in:
18
exprtk.hpp
18
exprtk.hpp
@ -67,7 +67,7 @@ namespace exprtk
|
||||
#define exprtk_error_location \
|
||||
"exprtk.hpp:" + details::to_str(__LINE__) \
|
||||
|
||||
#if __GNUC__ >= 7
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 7)
|
||||
|
||||
#define exprtk_disable_fallthrough_begin \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
@ -1320,8 +1320,8 @@ namespace exprtk
|
||||
template <typename T> inline T frac_impl(const T v, real_type_tag) { return (v - static_cast<long long>(v)); }
|
||||
template <typename T> inline T trunc_impl(const T v, real_type_tag) { return T(static_cast<long long>(v)); }
|
||||
|
||||
template <typename T> inline T const_pi_impl(real_type_tag) { return numeric::constant::pi; }
|
||||
template <typename T> inline T const_e_impl (real_type_tag) { return numeric::constant::e; }
|
||||
template <typename T> inline T const_pi_impl(real_type_tag) { return T(numeric::constant::pi); }
|
||||
template <typename T> inline T const_e_impl (real_type_tag) { return T(numeric::constant::e); }
|
||||
|
||||
template <typename T> inline T abs_impl(const T v, int_type_tag) { return ((v >= T(0)) ? v : -v); }
|
||||
template <typename T> inline T exp_impl(const T v, int_type_tag) { return std::exp (v); }
|
||||
@ -2780,7 +2780,7 @@ namespace exprtk
|
||||
Note: The following 'awkward' conditional is
|
||||
due to various broken msvc compilers.
|
||||
*/
|
||||
#if _MSC_VER == 1600
|
||||
#if defined(_MSC_VER) && (_MSC_VER == 1600)
|
||||
const bool within_range = !is_end(s_itr_ + 2) &&
|
||||
!is_end(s_itr_ + 3) ;
|
||||
#else
|
||||
@ -3761,7 +3761,7 @@ namespace exprtk
|
||||
case lexer::token::e_sub : return false;
|
||||
case lexer::token::e_colon : return false;
|
||||
case lexer::token::e_ternary : return false;
|
||||
default : return true;
|
||||
default : return true ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3775,7 +3775,7 @@ namespace exprtk
|
||||
case lexer::token::e_eof : return false;
|
||||
case lexer::token::e_colon : return false;
|
||||
case lexer::token::e_ternary : return false;
|
||||
default : return true;
|
||||
default : return true ;
|
||||
}
|
||||
}
|
||||
else if (details::is_left_bracket(static_cast<char>(t)))
|
||||
@ -5963,10 +5963,8 @@ namespace exprtk
|
||||
else
|
||||
return ((T(2) * arg1 <= (arg2 + arg0)) ? arg0 : arg2);
|
||||
|
||||
default : {
|
||||
exprtk_debug(("trinary_node::value() - Error: Invalid operation\n"));
|
||||
return std::numeric_limits<T>::quiet_NaN();
|
||||
}
|
||||
default : exprtk_debug(("trinary_node::value() - Error: Invalid operation\n"));
|
||||
return std::numeric_limits<T>::quiet_NaN();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user