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

int main(){
  double d,e;
  while(1){
    cin>>d>>e;
    if(d+e==0)break;
    double ans=1e9;
    for(int i=0;i<=d;i++)
      for(int j=0;j<=d;j++)
	if(i+j==d) ans=min(ans,abs(sqrt(i*i+j*j)-e));
    printf("%lf\n",ans);
  }
    return 0;
}