#include <iostream>
#include <cmath>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
#define INF 1e10
using namespace std;

int D, E;

int main(void) {
  while(cin >> D >> E, D || E) {
    double ans = INF;
    REP(i, 0, 101) REP(j, 0, 101) {
      if(i + j == D) ans = min(ans, abs(sqrt(i * i + j * j) - E));
    }
    cout << ans << endl;
  }
}