Automatic Differentiation
 
Loading...
Searching...
No Matches
log2.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_LOG2_HPP
2#define STAN_MATH_PRIM_FUN_LOG2_HPP
3
7#include <cmath>
8
9namespace stan {
10namespace math {
11
17inline constexpr double log2() { return LOG_TWO; }
18
22struct log2_fun {
30 template <typename T>
31 static inline auto fun(const T& x) {
32 using std::log2;
33 return log2(x);
34 }
35};
36
47template <typename T, require_not_var_matrix_t<T>* = nullptr,
48 require_not_nonscalar_prim_or_rev_kernel_expression_t<T>* = nullptr>
49inline auto log2(const T& x) {
51}
52
53} // namespace math
54} // namespace stan
55
56#endif
constexpr double log2()
Return natural logarithm of two.
Definition log2.hpp:17
static constexpr double LOG_TWO
The natural logarithm of 2, .
Definition constants.hpp:80
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9
Base template class for vectorization of unary scalar functions defined by a template class F to a sc...
static auto fun(const T &x)
Return the base two logarithm of the specified argument.
Definition log2.hpp:31
Structure to wrap log2() so it can be vectorized.
Definition log2.hpp:22