二进制开方
int MathInt_sqrt(unsigned long n)
{int root;int m;int left;root = 0;left = (int)n;m = 1 << (sizeof(int) * 8 - 2);do {if (( left & -m ) > root) {root += m;left -= root;root += m;}root >>= 1;} while (m >>= 2);return root;
}
?
轉(zhuǎn)載于:https://www.cnblogs.com/wusihdu/p/3625485.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
- 上一篇: promise实例
- 下一篇: 基于Flask开发企业级REST API