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

int main(){
	int d,e;
	double r;
	while(1){
		cin>>d>>e;
		if(d==0&&e==0) break;
		r=1000000;
		for(int i=0;i<=d;i++){
			r=min(r,abs(sqrt(i*i+(d-i)*(d-i))-e));
		}
		cout<<r<<endl;
	}
	return 0;
}
