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

int main(){

    while(true){
        double d,e;

        double ans = 100000000000.0;

        cin >> d >> e;

        if(d == 0.0 && e == 0.0){
            break;
        }

        int loop = static_cast<int>(d);

        for(int i=0; i<loop; i++){
            int y = loop - i;
            int x = i;

            ans = min(ans, abs(sqrt(x*x + y*y)-e));

        }

        cout << ans << endl;
    }

}
