import random


def randfloat(a, b, num=8):
    """Returns a random floating point number in range(a,b)."""
    num = 10**num
    a = int(a*num)
    b = int(b*num)
    x = random.randint(a, b)
    return x * (1.0/num)