Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ int_step()

template<typename T >
int stan::math::int_step ( const T &  y)
inline

The integer step, or Heaviside, function.

For double NaN input, int_step(NaN) returns 0.

\[ \mbox{int\_step}(x) = \begin{cases} 0 & \mbox{if } x \leq 0 \\ 1 & \mbox{if } x > 0 \\[6pt] 0 & \mbox{if } x = \textrm{NaN} \end{cases} \]

Template Parameters
Tvalue type
Parameters
[in]yvalue
Returns
1 if value is greater than 0 and 0 otherwise

Definition at line 27 of file int_step.hpp.