1 #ifndef STAN_MATH_PRIM_SCAL_FUN_LDEXP_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_LDEXP_HPP
3 
4 #include <stan/math/prim/scal/fun/exp2.hpp>
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>
ldexp(const T & a,int b)19 inline T ldexp(const T& a, int b) {
20   return a * exp2(b);
21 }
22 }  // namespace math
23 }  // namespace stan
24 
25 #endif
26