Stan Math Library  2.11.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 <boost/math/tools/promotion.hpp>
6 #include <stdexcept>
7 
8 namespace stan {
9 
10  namespace math {
11 
23  template <typename T>
24  inline typename boost::math::tools::promote_args<T>::type
25  log2(const T a) {
26  using std::log;
27  return log(a) / LOG_2;
28  }
29 
35  inline double log2() {
36  return LOG_2;
37  }
38 
39  }
40 }
41 
42 #endif
const double LOG_2
The natural logarithm of 2, .
Definition: constants.hpp:33
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15
fvar< T > log2(const fvar< T > &x)
Definition: log2.hpp:17

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