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

int main(){
	int D, E, min, temp, t;
	double ans;
	
	while(1){
		
		cin>>D>>E;
		
		if(D == 0 && E == 0) break;
		
		min = fabs(D * D - E * E);
		t = 0;
		
		for(int i = 1; i <= D/2 + 1; i++){
			temp = fabs(i * i + (D - i) * (D - i) - E * E);
			if(min > temp){
				min = temp;
				t = i;
			}
		}
		
		ans = fabs(pow(t * t + (D - t) *(D - t), 1.0/2.0)  - E);
		
		cout<<ans<<endl;
	}
	
	return 0;
}
