_scalb, _scalbl
float.h:インデックス への移動
ヘッダーファイル
float.h
カテゴリ
演算ルーチン
プロトタイプ
double _scalb(double d, long exp);
long double _scalbl(long double ld, long exp);
説明
引数 d と 2 の累乗の積を求めます。
_scalbl は long double バージョンです。long double 引数を受け取り,long double の結果を返します。
戻り値
成功した場合は,指数値を返します。オーバーフローの場合は,+/- HUGE_VAL(引数の符号による)を返します。ERRNO 変数は ERANGE に設定されます。
コード例
#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; }
移植性
POSIX | Win32 | ANSI C | ANSI C++ | |
---|---|---|---|---|
_scalb |
+ |
|||
_scalbl |
+ |