闲着无聊随便写一写
#include <iostream>
#include <math.h>float mSqrt( float number ){
float result = 0x5f3759df; //出自雷神中的开根号算法的黑魔法数
{
float temp = number / result;
result = ( temp + result ) / 2;
}
return result;
}
int main(){
std::cout << mSqrt(2) << std::endl;
return 0;
}