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

◆ operator+() [16/16]

var stan::math::operator+ ( const var a)
inline

Unary plus operator for variables (C++).

The function simply returns its input, because

\(\frac{d}{dx} +x = \frac{d}{dx} x = 1\).

The effect of unary plus on a built-in C++ scalar type is integer promotion. Because variables are all double-precision floating point already, promotion is not necessary.

\[ \mbox{operator+}(x) = \begin{cases} x & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]

\[ \frac{\partial\, \mbox{operator+}(x)}{\partial x} = \begin{cases} 1 & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]

Parameters
aArgument variable.
Returns
The input reference.

Definition at line 44 of file operator_unary_plus.hpp.