#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>

using namespace std;

int main() {
	int d, e;
	while (cin >> d >> e) {
		if (d == 0 && e == 0) {
			break;
		}
		double ans = 1000.0;
		for (int i = 0; i <= d; i++) {
			double x = i;
			double y = d - i;
			ans = min(ans, abs(sqrt(x*x + y*y)-e));
		}
		printf("%.5f\n", ans);
	}
	return 0;
}