#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#define REP(i,n) for (int i=0;i<(n);i++)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	int d,e;
	while(cin >> d >> e,d){
		double ans = 1e9;
		REP(i,d/2 + 1){
			ans = min(ans,fabs(sqrt(i*i + (d-i)*(d-i)) - e));
		}
		cout << ans << endl;
	}
  return 0;
}