@node ldexp, math @subheading Syntax @example #include double ldexp(double val, int exp); @end example @subheading Description This function computes @math{@var{val}*2^@var{exp}}. @subheading Return Value @math{@var{val}*2^@var{exp}}. @code{ldexp(0., exp)} returns 0 for all values of @code{exp}, without setting @code{errno}. For non-zero values of @var{val}, @code{errno} is set to @code{ERANGE} if the result cannot be accurately represented by a @code{double}, and the return value is then the nearest representable @code{double} (possibly, an @code{Inf}). If @var{val} is a @code{NaN} or @code{Inf}, the return value is @code{NaN} and @code{errno} is set to @code{EDOM}. @subheading Portability @portability ansi, posix @subheading Example @example ldexp(3.5,4) == 3.5 * (2^4) == 56.0 @end example