#include<iostream>
#include<cmath>
#include<cstdio>

using namespace std;

int main(void){

  int D,E;
  while(cin >> D >> E, D|E){
    double d = D,e = E,ans = 100000.0;
    for(double x=0;x<=d;x++){
      for(double y=0;y<=d;y++){
	double cost = abs(sqrt(x*x+y*y)-e);
	if(abs(x+y-d)<1e-8 && cost < ans - 1e-8){
	  ans=cost;
	}
      }
    }
    printf("%0.4f\n",ans);
  }
  
  return 0;
}