#!/usr/bin/env runghc
import Control.Applicative

hypot::Double->Double->Double
hypot a b = sqrt (a*a+b*b)

main=do
	[a,b] <- map (read :: String -> Int) . words <$> getLine
	if a/=0 then
		print (minimum (map (\i -> abs $ (realToFrac b)-(hypot (realToFrac i) (realToFrac (a-i)))) [0..(div a 2)]))
		>> main
	else
		return ()