Stan Math Library  2.15.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 
5 #include <cmath>
6 
7 namespace stan {
8  namespace math {
9 
20  inline double log2(double u) {
21  using std::log;
22  return log(u) / LOG_2;
23  }
24 
32  inline double log2(int u) {
33  return log2(static_cast<double>(u));
34  }
35 
41  inline double log2() {
42  return LOG_2;
43  }
44 
45  }
46 }
47 
48 #endif
const double LOG_2
The natural logarithm of 2, .
Definition: constants.hpp:32
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:14
fvar< T > log2(const fvar< T > &x)
Return the base two logarithm of the specified argument.
Definition: log2.hpp:19

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