<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://themidnight.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AExponential_search</id>
	<title>Module:Exponential search - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://themidnight.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AExponential_search"/>
	<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Exponential_search&amp;action=history"/>
	<updated>2026-04-07T08:33:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Exponential_search&amp;diff=7234&amp;oldid=prev</id>
		<title>Timothy: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Exponential_search&amp;diff=7234&amp;oldid=prev"/>
		<updated>2023-06-10T00:59:02Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:59, 9 June 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Timothy</name></author>
	</entry>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Exponential_search&amp;diff=7233&amp;oldid=prev</id>
		<title>wikipedia&gt;Uzume: strict</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Exponential_search&amp;diff=7233&amp;oldid=prev"/>
		<updated>2023-02-10T20:10:53Z</updated>

		<summary type="html">&lt;p&gt;strict&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:10, 10 February 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-- This module provides a generic exponential search algorithm.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-- This module provides a generic exponential search algorithm.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;require[[strict]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local checkType = require(&amp;#039;libraryUtil&amp;#039;).checkType&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local checkType = require(&amp;#039;libraryUtil&amp;#039;).checkType&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>wikipedia&gt;Uzume</name></author>
	</entry>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Exponential_search&amp;diff=1588&amp;oldid=prev</id>
		<title>Timothy: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Exponential_search&amp;diff=1588&amp;oldid=prev"/>
		<updated>2022-03-23T22:18:12Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:18, 23 March 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Timothy</name></author>
	</entry>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Exponential_search&amp;diff=1587&amp;oldid=prev</id>
		<title>wikipedia&gt;Mr. Stradivarius: Protected &quot;Module:Exponential search&quot;: High-risk Lua module: used in Module:Highest archive number ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Exponential_search&amp;diff=1587&amp;oldid=prev"/>
		<updated>2019-10-08T16:14:11Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/wiki/Module:Exponential_search&quot; title=&quot;Module:Exponential search&quot;&gt;Module:Exponential search&lt;/a&gt;&amp;quot;: &lt;a href=&quot;/index.php?title=WP:High-risk_templates&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:High-risk templates (page does not exist)&quot;&gt;High-risk Lua module&lt;/a&gt;: used in &lt;a href=&quot;/index.php?title=Module:Highest_archive_number&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Module:Highest archive number (page does not exist)&quot;&gt;Module:Highest archive number&lt;/a&gt; ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module provides a generic exponential search algorithm.&lt;br /&gt;
&lt;br /&gt;
local checkType = require(&amp;#039;libraryUtil&amp;#039;).checkType&lt;br /&gt;
local floor = math.floor&lt;br /&gt;
&lt;br /&gt;
local function midPoint(lower, upper)&lt;br /&gt;
	return floor(lower + (upper - lower) / 2)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function search(testFunc, i, lower, upper)&lt;br /&gt;
	if testFunc(i) then&lt;br /&gt;
		if i + 1 == upper then&lt;br /&gt;
			return i&lt;br /&gt;
		end&lt;br /&gt;
		lower = i&lt;br /&gt;
		if upper then&lt;br /&gt;
			i = midPoint(lower, upper)&lt;br /&gt;
		else&lt;br /&gt;
			i = i * 2&lt;br /&gt;
		end&lt;br /&gt;
		return search(testFunc, i, lower, upper)&lt;br /&gt;
	else&lt;br /&gt;
		upper = i&lt;br /&gt;
		i = midPoint(lower, upper)&lt;br /&gt;
		return search(testFunc, i, lower, upper)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return function (testFunc, init)&lt;br /&gt;
	checkType(&amp;#039;Exponential search&amp;#039;, 1, testFunc, &amp;#039;function&amp;#039;)&lt;br /&gt;
	checkType(&amp;#039;Exponential search&amp;#039;, 2, init, &amp;#039;number&amp;#039;, true)&lt;br /&gt;
	if init and (init &amp;lt; 1 or init ~= floor(init) or init == math.huge) then&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			&amp;quot;invalid init value &amp;#039;%s&amp;#039; detected in argument #2 to &amp;quot; ..&lt;br /&gt;
			&amp;quot;&amp;#039;Exponential search&amp;#039; (init value must be a positive integer)&amp;quot;,&lt;br /&gt;
			tostring(init)&lt;br /&gt;
		), 2)&lt;br /&gt;
	end&lt;br /&gt;
	init = init or 2&lt;br /&gt;
	if not testFunc(1) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	return search(testFunc, init, 1, nil)&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Mr. Stradivarius</name></author>
	</entry>
</feed>