fix the bug of random.RandFloats() infinite loop and the result of random.RandFloat() sometimes equals to max.