#include <bits/stdc++.h>
using namespace std;

#define int long long
const int INF = 1e18;

signed main() {
  int D, E;
  while ( cin >> D >> E, D ) {
    double ans = (double)INF;
    for ( int i = 0; i <= D; i++ ) {
      ans = min(ans, abs(sqrt(i*i+(D-i)*(D-i))-E));
    }

    cout << ans << endl;
  }
  
  return 0;
}

