import math A, B = map(int, input().split()) a = abs(A) b = abs(B) d = math.gcd(a, b) if a != 0 or b != 0 else 0 if d == 0: print("{0:.12f}".format(0.25)) else: total = 0.0 n = 0 while True: s = 2 + d * n term = (n + 1) / (s ** s) if term < 1e-20: # Break when term is negligible for precision break total += term n += 1 # Ensure the output has enough decimal places print("{0:.12f}".format(total))