#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
#define MOD 1000000007
using namespace std;
signed main() {
  double D, E;
  while(cin>>D>>E,D+E){
    double ans = INF;
    for (int x = 0; x <= 100; x++) {
      for (int y = 0; y <= 100; y++) {
        if (x + y == D) {
          ans = min(abs(sqrt(x*x+y*y)-E), ans);
        }
      }
    }
    if (ans == 0) {
      cout << 0 << endl;
    } else {
      cout << fixed << ans << endl;
    }
  }  
}

