Random number generator with interval.