b-a=5
Because rnd is a random number less than 1 and greater than 0, (b-a)*rnd=5*rnd means that 5*rnd is greater than 0 and less than 5.
(b-a)*rnd+a=5*rnd+5 It can be seen that when 5*rnd+5 is greater than 5 and less than 10 int (rounded), then int( 5*rnd+5) is greater than 5 and less than or equal to 9.
Int((b-a)*rnd+a) is greater than 5 and less than or equal to 9, plus 1. The range of values is 6- 10, and they are all integers.