_scalb, _scalbl
Remonter à float.h - Index
Header File
float.h
Category
Math Routines
Prototype
double _scalb(double d, long exp);
long double _scalbl(long double ld, long exp);
Description
Scales the argument d by a power of 2.
_scalbl is the long double version; it takes a long double argument and returns a long double result.
Return Value
Returns an exponential value if successful. On overflow (depending on the sign of the argument), the function returns +/– HUGE_VAL; the ERRNO variable is set to ERANGE.
Example
#include <float.h>
int _tmain(int argc, _TCHAR* argv[])
{
double number;
long exp;
/* Request the number and exponent */
printf("Enter the value and exponent: ");
scanf("%lf %u", &number, &exp);
/* Scale the number using */
printf("Number * (2^Exp) = %lf\n", _scalb(number, exp));
return 0;
}
Portability
| POSIX | Win32 | ANSI C | ANSI C++ | |
|---|---|---|---|---|
|
_scalb |
+ |
|||
|
_scalbl |
+ |