1#ifndef STAN_MATH_PRIM_FUN_IS_ODD_HPP
2#define STAN_MATH_PRIM_FUN_IS_ODD_HPP
17template <
typename T, require_
integral_t<T>* =
nullptr>
19 return n % 2 != 0 ? 1 : 0;
27 static inline int fun(
const T& x) {
28 return is_odd(
static_cast<int>(x));
39template <
typename T, require_container_t<T>* =
nullptr>
int is_odd(T n)
Return 1 if the integer is odd and 0 otherwise.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Base template class for vectorization of unary scalar functions defined by a template class F to a sc...
static int fun(const T &x)
Vectorization wrapper for is_odd.