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

◆ step() [1/3]

template<typename T , require_stan_scalar_t< T > * = nullptr>
T stan::math::step ( const T &  y)
inline

The step, or Heaviside, function.

The function is defined by

step(y) = (y < 0.0) ? 0 : 1.

\[ \mbox{step}(x) = \begin{cases} 0 & \mbox{if } x \le 0 \\ 1 & \mbox{if } x \ge 0 \\[6pt] 0 & \mbox{if } x = \textrm{NaN} \end{cases} \]

Template Parameters
Ttype of value
Parameters
yvalue
Returns
zero if the value is less than zero, and one otherwise

Definition at line 31 of file step.hpp.