object Main {
    def main(args: Array[String]) = {
        val in = io.Source.stdin.getLines.map(_.split(" ").map(_.toInt))
        for (Array(d, e) <- in if d != 0 || e != 0) {
            println((0 to d / 2).map(n => math.abs(math.sqrt((d - n) * (d - n) + n * n) - e)).min)
        }
    }
}