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

◆ logical_and()

template<typename T1 , typename T2 >
int stan::math::logical_and ( const T1  x1,
const T2  x2 
)
inline

The logical and function which returns 1 if both arguments are unequal to zero and 0 otherwise.

Equivalent to x1 != 0 && x2 != 0.

\[ \mbox{operator\&\&}(x, y) = \begin{cases} 0 & \mbox{if } x = 0 \textrm{ or } y=0 \\ 1 & \mbox{if } x, y \neq 0 \\[6pt] 1 & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]

Template Parameters
T1type of first argument
T2type of second argument
Parameters
x1first argument
x2second argument
Returns
true if both x1 and x2 are not equal to 0.

Definition at line 30 of file logical_and.hpp.