使用巴比伦算法找到平方根 [英] Using Babylonian algorithm to find square root

查看:169
本文介绍了使用巴比伦算法找到平方根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序正在尝试使用巴比伦算法来查找平方根...我有一个数字用于得到平方根,并且还有一个数字来运行循环...每当我走打印答案的四舍五入而不是给我我需要的答案......任何帮助??

my program is trying to use the babylonian algorithm in order to find the square root... i have a number for the number to have the square root taken of and also a number to run the loop... Whenever i go to print out the answer its rounding instead of giving me the answer i need... any help??

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | 换行 | 行号

推荐答案


for(double count = 1; count< = num2; count ++);
for (double count = 1; count <= num2; count++);



再看看这条线......

Just TAKE A LOOK at this line again.....


socondc22-


请查看您的私信(PM'),可通过页面右上角的链接访问。


谢谢
socondc22-

Please have a look at your Private Messages (PM''s) accessible through the link in the top right corner of the page.

Thanks



再看看这一行.....
Just TAKE A LOOK at this line again.....



我仍​​然不喜欢不知道出了什么问题...


I still don''t know what is wrong...


这篇关于使用巴比伦算法找到平方根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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