<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'Random Number (Integer) Generator'</title>
    <description>Snipplr comments feed</description>
    <link>https://ipv6.snipplr.com/</link>
    <lastBuildDate>Wed, 22 Apr 2026 07:19:32 +0000</lastBuildDate>
    <item>
      <title>mwalsh said on 01/Aug/2010</title>
      <link>https://ipv6.snipplr.com/view/37686/random-number-integer-generator</link>
      <description>&lt;p&gt;Math.min is unnecessary but doesn't actually hurt the calulation.&#13;
&#13;
Math.round, on the other hand, skews the numbers heavily away from the min and max values, you'll hardly ever get them.&#13;
&#13;
After some quick testing, this seems to work much better:&#13;
&#13;
&lt;code&gt;&#13;
Math.floor(Math.random() * (maxValue - minValue + 1)) + minValue;&#13;
&lt;/code&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 01 Aug 2010 04:24:04 UTC</pubDate>
      <guid>https://ipv6.snipplr.com/view/37686/random-number-integer-generator</guid>
    </item>
    <item>
      <title>Jamie said on 19/Aug/2010</title>
      <link>https://ipv6.snipplr.com/view/37686/random-number-integer-generator</link>
      <description>&lt;p&gt;Thanks for the feedback mwalsh!&#13;
Like most code, this was written out of utility, and it's very cool of you to help me refine it. I've updated the snippet.&#13;
Thanks!&lt;/p&gt;</description>
      <pubDate>Thu, 19 Aug 2010 07:26:39 UTC</pubDate>
      <guid>https://ipv6.snipplr.com/view/37686/random-number-integer-generator</guid>
    </item>
  </channel>
</rss>
