Stan Math Library  2.20.0
reverse mode automatic differentiation
log2.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_LOG2_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_LOG2_HPP
3 
6 #include <cmath>
7 
8 namespace stan {
9 namespace math {
10 
21 inline double log2(double u) {
22  using std::log;
23  return log(u) / LOG_2;
24 }
25 
33 inline double log2(int u) { return log2(static_cast<double>(u)); }
34 
40 inline double log2() { return LOG_2; }
41 
42 } // namespace math
43 } // namespace stan
44 
45 #endif
const double LOG_2
The natural logarithm of 2, .
Definition: constants.hpp:37
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:12
fvar< T > log2(const fvar< T > &x)
Return the base two logarithm of the specified argument.
Definition: log2.hpp:20

     [ Stan Home Page ] © 2011–2018, Stan Development Team.