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__AGRAD__FWD__FUNCTIONS__LOG2_HPP
2 #define STAN__AGRAD__FWD__FUNCTIONS__LOG2_HPP
3 
5 #include <stan/meta/traits.hpp>
8 
9 
10 namespace stan {
11 
12  namespace agrad {
13 
14  template <typename T>
15  inline
16  fvar<T>
17  log2(const fvar<T>& x) {
18  using std::log;
19  using stan::math::log2;
21  if(x.val_ < 0.0)
23  else
24  return fvar<T>(log2(x.val_), x.d_ / (x.val_ * stan::math::LOG_2));
25  }
26  }
27 }
28 #endif
const double LOG_2
The natural logarithm of 2, .
Definition: constants.hpp:32
fvar< T > log2(const fvar< T > &x)
Definition: log2.hpp:17
const double NOT_A_NUMBER
(Quiet) not-a-number value.
Definition: constants.hpp:53
boost::math::tools::promote_args< T >::type log2(const T a)
Returns the base 2 logarithm of the argument (C99).
Definition: log2.hpp:25
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15

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