rand_float function