Automatic Differentiation
 
Loading...
Searching...
No Matches
is_nonpositive_integer.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_IS_NONPOSITIVE_INTEGER_HPP
2#define STAN_MATH_PRIM_FUN_IS_NONPOSITIVE_INTEGER_HPP
3
6#include <cmath>
7
8namespace stan {
9namespace math {
10
17template <typename T>
18inline bool is_nonpositive_integer(T x) {
19 using std::floor;
20 return x <= 0.0 && floor(x) == x;
21}
22
23} // namespace math
24} // namespace stan
25
26#endif
fvar< T > floor(const fvar< T > &x)
Definition floor.hpp:13
bool is_nonpositive_integer(T x)
Returns true if the input is a nonpositive integer and false otherwise.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...