#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)

int main(){
    int d,e;
    while(cin >> d >> e && d){
        double ans = 1e9;
        rep(i,110)rep(j,110){
            if(i+j == d){
                ans = min(ans, abs(e-sqrt(i*i+j*j)));
            }
        }
        printf("%.10lf\n", ans);
    }
}