我如何计算一个数字的平方根,而无需使用内建?平方根、内建、数字

2023-09-11 04:38:20 作者:顽劣

如何建立方法,该方法返回给定nunber的开方?例如开方(16)返回4 随后再将sqrt(5)返回2.3 ......请帮助我使用Java和知道的Math.sqrt()API函数,但我需要方法本身

how can i create method which return sqrt of given nunber? for example sqrt(16) returns 4 and sqrt(5) returns 2.3... please help i am using java and know Math.sqrt() API function but i need method itself

推荐答案

有许多方法来计算平方根。试试这个http://en.wikipedia.org/wiki/Methods_of_computing_square_roots

There are numerous methods to compute Square root. Try this http://en.wikipedia.org/wiki/Methods_of_computing_square_roots