Previous Page
Next Page

scalbln, scalbn

Multiplies a floating-point number by a power of the floating-point radix

#include <math.h>
double scalbn ( double x , int n  );
float scalbnf ( float x , int n  );
long double scalbnl ( long double x , int n  );

double scalbln ( double x , long int n  );
float scalblnf ( float x , long int n  );
long double scalblnl ( long double x , long int n  );

The scalbn( ) and scalbln( ) functions multiply a floating-point number x by an integer power of FLT_RADIX, providing a more efficient calculation than the arithmetic operators. The symbolic constant FLT_RADIX, defined in float.h, indicates the base of the floating-point environment's exponent representation; this is usually 2, for binary exponent representation. In this case, the return value of the scalbn( ) and scalbln( ) functions is x x 2n.

Example

See the example for feholdexcept( ) in this chapter.

See Also

frexp( ), ldexp( )


Previous Page
Next Page