var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr = input.trim().split("\n");
while (true) {
   var [d, e] = arr.shift().split(" ").map(Number);
   if (d == 0 && e == 0) break;
   var min = Infinity;
   for (var i = 0; i < d; i++) min = Math.min(min, Math.abs(Math.sqrt(i * i + (d - i) * (d - i)) - e));
   console.log(min.toFixed(10));
}
