Stan Math Library: stan/math/prim/scal/fun/log2.hpp Source File

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <stan/math/prim/scal/fun/constants.hpp>
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
stan::math::LOG_2
const double LOG_2
The natural logarithm of 2, .
Definition: constants.hpp:33
stan
Definition: log_sum_exp.hpp:8
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15
constants.hpp
stan::math::log2
fvar< T > log2(const fvar< T > &x)
Definition: log2.hpp:17

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