ldexp.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_LDEXP_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_LDEXP_HPP
3 
5 
6 namespace stan {
7 namespace math {
8 
9 /**
10  * Returns the product of a (the significand) and
11  * 2 to power b (the exponent).
12  *
13  * @tparam T Scalar type of significand
14  * @param[in] a the significand
15  * @param[in] b an integer that is the exponent
16  * @return product of a times 2 to the power b
17  */
18 template <typename T>
19 inline T ldexp(const T& a, int b) {
20  return a * exp2(b);
21 }
22 } // namespace math
23 } // namespace stan
24 
25 #endif
T ldexp(const T &a, int b)
Definition: ldexp.hpp:19
const double a
fvar< T > exp2(const fvar< T > &x)
Definition: exp2.hpp:13
const hit & b
Definition: hits.cxx:21
double T
Definition: Xdiff_gwt.C:5