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

int main() {
    int d, e;
    while (cin >> d >> e, d || e) {
        double err = 1e9+7;
        for (int i = 0; i <= d; i++) {
            err = min(err, abs(sqrt(i * i + (d - i) * (d - i)) - e));
        }

        cout << err << endl;
    }

    return 0;
}

