Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
log2.hpp
Go to the documentation of this file.
1 #ifndef STAN__MATH__FUNCTIONS__LOG2_HPP
2 #define STAN__MATH__FUNCTIONS__LOG2_HPP
3 
4 #include <stdexcept>
5 #include <boost/math/tools/promotion.hpp>
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:32
boost::math::tools::promote_args< T >::type log2(const T a)
Returns the base 2 logarithm of the argument (C99).
Definition: log2.hpp:25
Eigen::Matrix< T, Rows, Cols > log(const Eigen::Matrix< T, Rows, Cols > &m)
Return the element-wise logarithm of the matrix or vector.
Definition: log.hpp:16
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15

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