C++ STL 中的 beta()、betaf() 和 betal() 函数
函数beta()、betaf()和betal()是C++标准模板库中的内置函数。这些函数用于计算两个正实数的beta函数。
函数beta()、betaf()和betal()是C++标准模板库中的内置函数。这些函数用于计算两个正实数的beta函数。
$B(x,y)=\int_{0}^{1}t^{(x-1)}(1-t)^{(y-1)}dt$
beta()
该beta()函数用于处理双精度数据类型的值,即它接受双精度类型的参数并返回双精度值。
语法
double beta(double x, double y)
参数
x is a double value that gives the value of x in the beta function. y is a double value that gives the value of y in the beta function.
返回一个double值,它是beta函数结果。
示例
#includeusing namespace std; int main(){ double x = 4.93; double y = 5.01; double result = beta(x, y); cout<<"B("< 输出结果 B(4.93 , 5.01) = 0.00166054betaf()
该betaf()函数用于处理数据类型为float的值,即它接受float类型的参数并返回float值。
语法
float beta(float x, float y参数
x is a float value that gives the value of x in the beta function. y is a float value that gives the value of y in the beta function.返回一个浮点值,它是beta函数结果。
示例
#includeusing namespace std; int main(){ float x = 0.31; float y = 3.99; float result = betaf(x, y); cout<<"B("< 输出结果 B(0.31 , 3.99) = 1.93395betal()
该betal()函数用于处理longdouble数据类型的值,即它接受longdouble类型的参数并返回一个longdouble值。
语法
长双beta(longdoublex,longdoubley)
参数
x is a long double value that gives the value of x in the beta function. y is a long double value that gives the value of y in the beta function.返回一个longdouble值,它是beta函数结果。
示例
#includeusing namespace std; int main(){ long double x = 3453.35451; long double y = 9862.89651; long double result = betaf(x, y); cout<<"B("< 输出结果 B(3453.35 , 9862.9) = 4.39947e-3312
热门推荐
10 春季祝福语女生文案简短
11 高考祝福语简短10字
12 年前幸福祝福语大全简短
13 宝子生日祝福语简短
14 给长辈祝福语简短大全
15 考试祝福语日文简短版
16 女儿结婚账单祝福语简短
17 舅妈生日红包祝福语简短
18 六十岁大寿祝福语简短