include Math

loop do
    d, e = gets.split.map(&:to_i)
    break if d == 0

    x = nil
    if 2 * e * e <= d * d
        x = d / 2.0
    elsif d <= e
        x = d
    else
        x = (d + sqrt(2 * e * e - d * d)) / 2
    end

    x1 = x.floor
    x2 = x.ceil

    p [x1, x2].map {|x| (sqrt(x**2 + (d-x)**2) - e).abs}.min
end