寻找第n个根 [英] Finding nth root

查看:90
本文介绍了寻找第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...

推荐答案

AFAIK,没有像SQRT()这样的内置函数.

要获得给定数字的第n个根,我现在可以想到以下两个:
方法1:
AFAIK, there is no inbuilt function like SQRT().

To get the nth root of a given number, these two I can think of for now:
Way 1:
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个根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆