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

int main() {
  int d, e;
  do {
    cin >> d >> e;
    if(d+e == 0) return 0;
    long double ans = 999999999;
    for(int x = 0; x <= d; x++) {
      int y = d - x;
      long double xx = (double)x;
      long double yy = (double)y;
      long double a = sqrt(xx*xx + yy*yy);
      ans = min(ans, abs(a - e));
    }
    printf("%.10Lf\n", ans);
  } while(1);
}

