<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FHellknowz%2FMisc</id>
	<title>Module:Sandbox/Hellknowz/Misc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FHellknowz%2FMisc"/>
	<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:Sandbox/Hellknowz/Misc&amp;action=history"/>
	<updated>2026-05-01T14:32:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://70.231.62.181/index.php?title=Module:Sandbox/Hellknowz/Misc&amp;diff=17860090&amp;oldid=prev</id>
		<title>imported&gt;Mr. Stradivarius: r2 needs to use math.ceil, not math.floor - but nice algorithm! It&#039;s a lot easier to understand as code.</title>
		<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:Sandbox/Hellknowz/Misc&amp;diff=17860090&amp;oldid=prev"/>
		<updated>2013-11-28T10:37:53Z</updated>

		<summary type="html">&lt;p&gt;r2 needs to use math.ceil, not math.floor - but nice algorithm! It&amp;#039;s a lot easier to understand as code.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.rand(max)&lt;br /&gt;
	&lt;br /&gt;
	math.randomseed(mw.site.stats.edits)&lt;br /&gt;
	&lt;br /&gt;
	if (max &amp;lt;= 2147483648) then&lt;br /&gt;
		return math.random(max)&lt;br /&gt;
	else&lt;br /&gt;
		local ratio = max / 2147483648&lt;br /&gt;
		local r1 = math.floor(math.random(2147483648-1) * ratio)&lt;br /&gt;
		local r2 = math.random(math.ceil(ratio))&lt;br /&gt;
		return r1 + r2&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.random(frame)&lt;br /&gt;
	return p.rand(0 + frame.args[1])&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Mr. Stradivarius</name></author>
	</entry>
</feed>