boost_isnan.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_SCAL_FUN_BOOST_ISNAN_HPP
2 #define STAN_MATH_REV_SCAL_FUN_BOOST_ISNAN_HPP
3 
4 #include <boost/math/special_functions/fpclassify.hpp>
5 #include <stan/math/rev/core.hpp>
6 
7 namespace boost {
8 namespace math {
9 
10 /**
11  * Checks if the given number is NaN
12  *
13  * Return <code>true</code> if the specified variable
14  * has a value that is NaN.
15  *
16  * @param v Variable to test.
17  * @return <code>true</code> if variable is NaN.
18  */
19 template <>
20 inline bool isnan(const stan::math::var& v) {
21  return (boost::math::isnan)(v.val());
22 }
23 
24 } // namespace math
25 } // namespace boost
26 #endif
bool isnan(const stan::math::var &v)
Definition: boost_isnan.hpp:20
double val() const
Definition: var.hpp:294