tag:blogger.com,1999:blog-8980734269859237005.post6388997440161553756..comments2024-01-30T01:03:21.768-08:00Comments on DevCurry: Generate Random Numbers Within a Range using JavaScriptSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8980734269859237005.post-41364804822884949132011-03-02T21:18:33.608-08:002011-03-02T21:18:33.608-08:00Ben: In that case use the following:
Math.floor(M...Ben: In that case use the following:<br /><br />Math.floor(Math.random()*(Y-X)) + X;<br /><br />Although I have not tested it, but it should work!Suprotim Agarwalhttps://www.blogger.com/profile/08349831623922214390noreply@blogger.comtag:blogger.com,1999:blog-8980734269859237005.post-76012673413730037382011-03-02T18:12:33.484-08:002011-03-02T18:12:33.484-08:00Thanks! What if I want it to be equal than or grea...Thanks! What if I want it to be equal than or greater to X, but less than Y?<br /><br />benjamin.morse.archer@gmail.comAnonymousnoreply@blogger.com