Loading web-font TeX/Main/Regular
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

◆ square() [4/7]

template<typename T , require_arithmetic_t< T > * = nullptr>
double stan::math::square ( const T  x)
inline

Return the square of the specified argument.

\mbox{square}(x) = x^2.

The implementation of square(x) is just x * x. Given this, this method is mainly useful in cases where x is not a simple primitive type, particularly when it is an autodiff type.

Parameters
xInput to square.
Returns
Square of input.

Definition at line 27 of file square.hpp.