log2.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_FWD_SCAL_FUN_LOG2_HPP
#define STAN_MATH_FWD_SCAL_FUN_LOG2_HPP
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
#include <stan/math/prim/scal/fun/log2.hpp>
namespace stan {
namespace math {
template <typename T>
inline fvar<T> log2(const fvar<T>& x) {
if (x.val_ < 0.0)
return fvar<T>(NOT_A_NUMBER, NOT_A_NUMBER);
else
return fvar<T>(log2(x.val_), x.d_ / (x.val_ * LOG_2));
}
}
}
#endif
stan::math::LOG_2
const double LOG_2
The natural logarithm of 2, .
Definition: constants.hpp:32
core.hpp
stan::math::fvar::d_
T d_
Definition: fvar.hpp:16
stan::math::NOT_A_NUMBER
const double NOT_A_NUMBER
(Quiet) not-a-number value.
Definition: constants.hpp:55
stan
Definition: log_sum_exp.hpp:8
stan::math::fvar::val_
T val_
Definition: fvar.hpp:15
constants.hpp
log2.hpp
stan::math::log2
fvar< T > log2(const fvar< T > &x)
Return the base two logarithm of the specified argument.
Definition: log2.hpp:19
stan::math::fvar
Definition: fvar.hpp:14

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