1 #ifndef STAN_MATH_PRIM_SCAL_FUN_FDIM_HPP 2 #define STAN_MATH_PRIM_SCAL_FUN_FDIM_HPP 5 #include <boost/math/tools/promotion.hpp> 22 template <
typename T1,
typename T2>
23 inline typename boost::math::tools::promote_args<T1, T2>::type
25 typedef typename boost::math::tools::promote_args<T1, T2>::type return_t;
26 using std::numeric_limits;
28 return numeric_limits<return_t>::quiet_NaN();
29 return (x <= y) ? 0 : x - y;
fvar< T > fdim(const fvar< T > &x, const fvar< T > &y)
Return the positive difference of the specified values (C++11).
int is_nan(const fvar< T > &x)
Returns 1 if the input's value is NaN and 0 otherwise.