Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialShung Chen
6,526 PointsBit confused with whether the function work or not
what if math.random generate a number close to 0.99, with the low number being 10 and the high being 100.
there will be chances where it is actually a number of 100 instead 11 to 99?
1 Answer
Steven Parker
231,153 PointsThe possible range of numbers depends on both the formula used and the parameters given. The formula shown in the video is inclusive of the limits, so if you provide 10 and 100 as the limits, you could indeed get the number 10 as a result, or 100, or any number in between.
There are other formulas that are exclusive of the limits, so 10 and 100 would give you a number from 11 to 99, but that formula is not shown in the course video.
Shung Chen
6,526 PointsShung Chen
6,526 Pointsoh that makes sense now i thought they are developing a formula for random number up to 99 only