<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hant-TW">
	<id>https://encyclo-sanctum.encyclato.org/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E7%B5%84%3AExponential_search</id>
	<title>模組:Exponential search - 修訂紀錄</title>
	<link rel="self" type="application/atom+xml" href="https://encyclo-sanctum.encyclato.org/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E7%B5%84%3AExponential_search"/>
	<link rel="alternate" type="text/html" href="https://encyclo-sanctum.encyclato.org/index.php?title=%E6%A8%A1%E7%B5%84:Exponential_search&amp;action=history"/>
	<updated>2026-09-17T18:12:28Z</updated>
	<subtitle>本wiki上此頁面的修訂紀錄</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://encyclo-sanctum.encyclato.org/index.php?title=%E6%A8%A1%E7%B5%84:Exponential_search&amp;diff=160&amp;oldid=prev</id>
		<title>LatO：​已匯入 1 筆修訂</title>
		<link rel="alternate" type="text/html" href="https://encyclo-sanctum.encyclato.org/index.php?title=%E6%A8%A1%E7%B5%84:Exponential_search&amp;diff=160&amp;oldid=prev"/>
		<updated>2026-09-17T09:22:08Z</updated>

		<summary type="html">&lt;p&gt;已匯入 1 筆修訂&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&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;zh-Hant-TW&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上個修訂&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年9月17日 (四) 09:22的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hant-TW&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（無差異）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key mediawiki:diff:1.41:old-159:rev-160 --&gt;
&lt;/table&gt;</summary>
		<author><name>LatO</name></author>
	</entry>
	<entry>
		<id>https://encyclo-sanctum.encyclato.org/index.php?title=%E6%A8%A1%E7%B5%84:Exponential_search&amp;diff=159&amp;oldid=prev</id>
		<title>國家模板&gt;Hamish：​[IPE-NEXT] Quick edit imported from :w:en:Module:Exponential search</title>
		<link rel="alternate" type="text/html" href="https://encyclo-sanctum.encyclato.org/index.php?title=%E6%A8%A1%E7%B5%84:Exponential_search&amp;diff=159&amp;oldid=prev"/>
		<updated>2026-09-03T21:42:17Z</updated>

		<summary type="html">&lt;p&gt;[IPE-NEXT] Quick edit imported from &lt;a href=&quot;/index.php?title=W:en:Module:Exponential_search&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;W:en:Module:Exponential search（頁面不存在）&quot;&gt;w:en:Module:Exponential search&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新頁面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module provides a generic exponential search algorithm.&lt;br /&gt;
require[[strict]]&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>國家模板&gt;Hamish</name></author>
	</entry>
</feed>