import std.stdio, std.string, std.conv, std.algorithm, std.numeric;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

void main() {
    while (true) {
        int d, e;
        scan(d, e);
        if(!d) return;

        double ans = 10^^7;

        foreach (x ; 0 .. d + 1) {
            int y = d - x;
            auto L = hypot(x, y);
            ans = min(ans, fabs(L - e));
        }

        writefln("%.8f", ans);
    }
}

void solve(int n, int a, int b, int[] p) {
    int difmax, ans;

    foreach (i ; a .. b + 1) {
        if (difmax <= p[i-1] - p[i]) {
            difmax = p[i-1] - p[i];
            ans = i;
        }
    }

    writeln(ans);
}

void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}