Stan Math Library
5.0.0
Automatic Differentiation
|
Returns the truncation of the specified variable (C99).
See trunc() for the double-based version.
The derivative is zero everywhere but at integer values, so for convenience the derivative is defined to be everywhere zero,
\(\frac{d}{dx} \mbox{trunc}(x) = 0\).
\[ \mbox{trunc}(x) = \begin{cases} \lfloor x \rfloor & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{trunc}(x)}{\partial x} = \begin{cases} 0 & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
a | Specified variable. |