优分期不还钱技巧:c#中幂函数怎样表示

来源:百度文库 编辑:高校问答 时间:2024/05/08 20:01:54
比如表示a的b次方
应该怎么写

C#中是这样定义幂函数的:

public static double Pow(
double x,
double y
);

x 底数。
y 指数。

这个方法是放在System.Math命名空间下,可以这样调用:

private double GetPowValue()
{
return (Math.Pow(4,2.0));
}

Pow 函数的定义。

public static double Pow(
double x,
double y
);

调用的例子

double result = System.Math.Pow(5, 3);

pow(a,b)

very good , same top level.