摘要: 今天在C和指针P63看到了这个计算公式,ai+1= ( ai + number/ai) / 2。之前也有在网上看到过,不过出处忘了,记得好像是关于组合数学还是数论里面的一个内容。公式很简单,理论这个我就不懂了,还希望各位给指导一下。下面贴出自己的代码,作为记忆保留。 1 float my_sqrt(float number) { 2 float new_guess; 3 float last_guess; 4 5 if (number < 0) { 6 printf("Cannot compute the square root of a ne... 阅读全文
posted @ 2012-09-13 11:24 ziyoudefeng 阅读(3224) 评论(2) 推荐(0) 编辑