#include <iostream>
#include <cmath>
using namespace std;
int x,y,d,e;
double len,minn;
int main(){
	while(1){
		cin >> d>>e;
		if(!(d||e))break;
		minn=10000;
		for(int i=0;i<d;i++){
			x=i;
			y=d-x;
			len=sqrt(x*x+y*y);
			if(fabs(len-e)<minn)minn=fabs(len-e);
		}
		cout << minn<<endl;
	}
}