Sha256: e7e590e10ecfde0363bc4c98536b1fb536faa00d40b98c9993146a5c56dcf918
Contents?: true
Size: 1.73 KB
Versions: 4
Compression:
Stored size: 1.73 KB
Contents
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>ints (RFuzz::RandomGenerator)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre> <span class="ruby-comment cmt"># File lib/rfuzz/random.rb, line 96</span> 96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ints</span>(<span class="ruby-identifier">count</span>, <span class="ruby-identifier">max</span> = <span class="ruby-keyword kw">nil</span>) 97: <span class="ruby-identifier">i</span> = <span class="ruby-ivar">@rnd</span>.<span class="ruby-identifier">data</span>(<span class="ruby-identifier">count</span> <span class="ruby-operator">*</span> <span class="ruby-value">4</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">"N*"</span>) 98: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">max</span> 99: <span class="ruby-identifier">i</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">max</span> } 100: <span class="ruby-keyword kw">end</span> 101: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">i</span> 102: <span class="ruby-keyword kw">end</span></pre> </body> </html>
Version data entries
4 entries across 4 versions & 1 rubygems