我想找到立方根? [英] I want to find the cube root ?
本文介绍了我想找到立方根?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果数字(unm1)是用户输入的数字。
我尝试过我找不到解决方案。
我是新手程序员。
一个尝试的例子
double f = Math.Sqrt(Math.Sqrt(num1));
谢谢!!!!
If the number (unm1) is the number entered by the user.
I tried I did not find the solution.
I am a novice programmer.
An example of attempts
double f = Math.Sqrt(Math.Sqrt(num1));
thanks!!!!
推荐答案
平方根的平方根不是立方根:
多维数据集x = y * y * y
或x = y 3
但是如果:
Sqrt(Sqrt(x))== y
然后
Sqrt(x)= y * y
和
x =(y * y)*(y * y)
或x = y 4
所以Bruno说:
The square root of a square root isn't a cube root:
The Cube of x = y * y * y
or x = y3
But if:
Sqrt(Sqrt(x)) == y
Then
Sqrt(x) = y * y
And
x = (y * y) * (y * y)
or x = y4
So as Bruno says:
private double CubeRoot(double x)
{
return Math.Pow(x, (1.0 / 3.0));
}
使用.NET Framework的System.Math.Pow方法的简单方法:
A simple way using the .NET Framework's System.Math.Pow method:
public double CubeRoot(double d)
{
return (System.Math.Pow(d, (1.0/3.0)));
}
这篇关于我想找到立方根?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文