寻找第n个根

扫码查看
本文介绍了寻找第n个根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

vb.net中有什么方法可以找到数字的第n个根吗?

我们知道有sqrt()可以找到平方根.

有没有找到立方根的函数,等等...

Is there any method in vb.net to find the n''th root of a number??

As we know there is sqrt() to find the square root .

Is there any function to find the cube root and so on...

推荐答案

dblCubeRoot = dblNumber ^ (1/3)


您可以将"3"更改为您想要获取的任何根.例如:(1/n)

方法2:


You can change ''3'' to be whatever root you''re trying to get. Ex: (1/n)

Way 2:

double power = 1.0 / 5.0; // n=5 here
double secondnum = Math.Pow(firstnum, power); 


使用 Math.Pow [ ^ ]方法.


Use Math.Pow [^]method.


这篇关于寻找第n个根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 04:31
查看更多