文件名称:63
介绍说明--下载内容均来自于网络,请自行研究使用
用减奇数次数的方法,求一个数的近似平方根,这个平方根是一个整数。如求17的平方根,可以用17相继减去奇数1、3、5、7、…,当结果为 负数时停止,即:
17-1-3-5-7-9<0
可以看出,17在减去5次奇数后结果变为负数,可以近似认为17的平方根在4与5之间,计算NUM的平方根,如果NUM=17,则ANS中保存结果4。
-Save odd-frequency method, find a number of approximate square root of the square root is an integer. Such as for the square root of 17, 17 can be used successively subtracting the odd-numbered 1,3,5,7, ..., and stopped when the result is negative, i.e.: 17-1-3-5-7-9 < 0 As can be seen, 17 minus 5 odd result becomes negative, can be approximated by the square root of 17 is between 4 and 5 to calculate the square root of the NUM, if num = 17, then save the results of the ANS.
17-1-3-5-7-9<0
可以看出,17在减去5次奇数后结果变为负数,可以近似认为17的平方根在4与5之间,计算NUM的平方根,如果NUM=17,则ANS中保存结果4。
-Save odd-frequency method, find a number of approximate square root of the square root is an integer. Such as for the square root of 17, 17 can be used successively subtracting the odd-numbered 1,3,5,7, ..., and stopped when the result is negative, i.e.: 17-1-3-5-7-9 < 0 As can be seen, 17 minus 5 odd result becomes negative, can be approximated by the square root of 17 is between 4 and 5 to calculate the square root of the NUM, if num = 17, then save the results of the ANS.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
63.asm