#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


//INSERT ABOVE HERE
signed main(){
  int d,e;
  while(cin>>d>>e,d){
    using D = double;
    D res=1e9;
    for(int x=0;x<=d;x++){
      int y=d-x;
      chmin(res,abs(hypot(D(x),D(y))-D(e)));
    }
    cout<<fixed<<setprecision(12)<<res<<endl;
  }
  return 0;
}

