1#ifndef STAN_MATH_PRIM_FUN_SIGN_HPP
2#define STAN_MATH_PRIM_FUN_SIGN_HPP
11template <
typename T, require_stan_scalar_t<T>* =
nullptr>
12inline int sign(
const T& z) {
13 return (z == 0) ? 0 : z < 0 ? -1 : 1;
28 static inline int fun(
const T& x) {
41template <
typename T, require_container_t<T>* =
nullptr>
42inline auto sign(
const T& x) {
43 return apply_scalar_unary<sign_fun, T>::apply(x);
auto sign(const T &x)
Returns signs of the arguments.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
static int fun(const T &x)
Return the sign of the specified argument.
Structure to wrap sign() so it can be vectorized.