function Main(input){
    input = input.split("\n");
    var k = 0;
    while(1){
        input[k] = input[k].split(" ");
        var d = parseInt(input[k][0],10);
        var e = parseInt(input[k++][1],10);
        if(d == 0 && e == 0)
            break;

        var min = 100000000;
        for(var i = 0;i <= d;i++){
            if(Math.abs(e - Math.sqrt(i * i + (d - i) * (d - i))) < min)
                min = Math.abs(e - Math.sqrt(i * i + (d - i) * (d - i)));
        }
        console.log(min);
    }
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));