#include <bits/stdc++.h>
#define inf 999999999

using namespace std;

int d,e;
double ans;

int main(){
  int i,j;
  while(1){
    cin >> d >> e;
    if(d+e==0)break;
    ans = inf;
    for(i=0;i<d;i++){
      double x;
      x = abs(sqrt(i*i+(d-i)*(d-i))-e);
      if(ans>x)ans = x;
    }
    cout << ans << endl;
  }
  return 0;
}

