double log2(double x)
{
double l=0,r=30, lv=pow(2,l), rv=pow(2,r) ;
double m;
while(r-l>=eps)
{
m=(l+r)/2;
double mv=sqrt(lv * rv);
if(mv-x>eps) {r=m; rv=mv;}
else if(x-mv>eps) {l=m; lv=mv;}
else return m;
cout<<m<<endl;
}
return m;
}
int main()
{
double re=log2(1000);
printf("%f\n",re);
return 0;
}