计算数字的第n个根 [英] Calculating the nth root of a number

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

问题描述

如何编写函数来计算数字的第n个根;我是b / b
厌倦了使用带有小数指数的pow()来完成这项工作。有关于如何做到这一点的任何想法?b $ b想法?感谢您的帮助!!!

How do I write a function to calculate the nth root of a number; I''m
sick of using pow() with a fractional exponent to do the job. Got any
ideas on how to do this? Thanks for the help!!!

推荐答案

pow()就像它获得的一样简单。你想要什么?

pow() is as simple as it gets. What do you want?


我正在努力做这个学术练习;你能告诉我如何在代码中实现除法和平均方法吗?感谢您的帮助!!!

I''m trying to do this as academic exercise; could you tell me how to
implement the divide and average method in code? Thanks for the help!!!


1)您的问题是(虽然是情绪化的)主题方式(C ++)

2 )为什么不先询问互联网?


Google在类似

+平方根+立方根+第n根+算法等方面给出了很好的结果


顺便说一下 - 你有没有完成任务? (例如你的PI计算

- 我能看到来源吗?)


/ Thorbj?rn

1) Your questions is (though intereressing) way of topic (C++)
2) And why dont you seach the internet first before asking ?

Google gives good results on something like
+square root +cubic root +nth root +algorithms

And by the way - do you ever complete a task ? (Eg your PI calculations
- can I see the source ?)

/Thorbj?rn


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

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