C ++中的ldexp()
该函数ldexp()用于计算浮点值“a”与乘幂2的乘积。它有两个参数,第一个是浮点数,第二个是整数。
这是的数学表达式ldexp(),
ldexp() = a * 2^b
这是ldexp()C++语言的语法,
float ldexp(float variable1 , int variable2)
这里,
variable1-给变量的 任何表示有效数的名称。
variable2- 给变量的代表指数的任何名称。
这是ldexp()C++语言的示例,
示例
#include <iostream>
#include <cmath>
using namespace std;
int main() {
float x = 28.8;
int y = 3;
cout << "The value : " << ldexp(x, y);
return 0;
}输出结果
这是输出
The value : 230.4
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短