#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
using namespace std;

int main(){
    double d, e;
    while(cin >> d >> e, d){
        double ans = 1e9;
        for(double x = 0.0 ; x <= d ; x += 1.0){
            double y = d - x;
            ans = min(ans, abs(sqrt(x * x + y * y) - e));
        }
        cout << fixed << setprecision(6) << ans << endl;
    }

    return 0;
}
