Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs 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

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