1 #ifndef STAN_MATH_PRIM_SCAL_FUN_FDIM_HPP 2 #define STAN_MATH_PRIM_SCAL_FUN_FDIM_HPP 8 #include <boost/math/tools/promotion.hpp> 24 template <
typename T1,
typename T2>
25 inline typename boost::math::tools::promote_args<T1, T2>::type
fdim(T1 x,
27 typedef typename boost::math::tools::promote_args<T1, T2>::type return_t;
28 using std::numeric_limits;
31 return (x <= y) ? 0 : x - y;
const double NOT_A_NUMBER
(Quiet) not-a-number value.
bool is_any_nan(const T &x)
Returns true if the input is NaN and false otherwise.
fvar< T > fdim(const fvar< T > &x, const fvar< T > &y)
Return the positive difference of the specified values (C++11).