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

int main() {

    int d, e;
    while (cin >> d >> e and (d or e)) {

        double ans = 1e8;
        for (int y=0; y<=100; ++y) {
            for (int x=0; x<=100; ++x) {
                if (x+y == d) {
                    ans = min(abs(sqrt((x*x)+(y*y))-e), ans);
                }
            }
        }

        printf("%.10f\n", ans);

    }
}