<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://9on0wiki.gunmu.dns.navy/index.php?action=history&amp;feed=atom&amp;title=Module%3AExponential_search</id>
	<title>Module:Exponential search - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://9on0wiki.gunmu.dns.navy/index.php?action=history&amp;feed=atom&amp;title=Module%3AExponential_search"/>
	<link rel="alternate" type="text/html" href="https://9on0wiki.gunmu.dns.navy/index.php?title=Module:Exponential_search&amp;action=history"/>
	<updated>2026-08-27T17:31:45Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://9on0wiki.gunmu.dns.navy/index.php?title=Module:Exponential_search&amp;diff=720&amp;oldid=prev</id>
		<title>DoubleCircle：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://9on0wiki.gunmu.dns.navy/index.php?title=Module:Exponential_search&amp;diff=720&amp;oldid=prev"/>
		<updated>2026-08-26T10:58:54Z</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&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年8月26日 (三) 10:58的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;zh&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-719:rev-720 --&gt;
&lt;/table&gt;</summary>
		<author><name>DoubleCircle</name></author>
	</entry>
	<entry>
		<id>https://9on0wiki.gunmu.dns.navy/index.php?title=Module:Exponential_search&amp;diff=719&amp;oldid=prev</id>
		<title>zhwp&gt;Xiplus-abot：​已更改“Module:Exponential search”的保护设置：​高風險模板：121389引用&lt;!-- 機器人3 --&gt;​（[编辑=仅允许管理员]（无限期）​[移动=仅允许管理员]（无限期））</title>
		<link rel="alternate" type="text/html" href="https://9on0wiki.gunmu.dns.navy/index.php?title=Module:Exponential_search&amp;diff=719&amp;oldid=prev"/>
		<updated>2025-03-26T20:51:06Z</updated>

		<summary type="html">&lt;p&gt;已更改“&lt;a href=&quot;/wiki/Module:Exponential_search&quot; title=&quot;Module:Exponential search&quot;&gt;Module:Exponential search&lt;/a&gt;”的保护设置：​高風險模板：121389引用&amp;lt;!-- &lt;a href=&quot;/index.php?title=User:Xiplus-abot/task/3&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Xiplus-abot/task/3（页面不存在）&quot;&gt;機器人3&lt;/a&gt; --&amp;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;
&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;无效的初始值 &amp;#039;%s&amp;#039; 在参数 #2 中检测到&amp;quot; ..&lt;br /&gt;
			&amp;quot;&amp;#039;Exponential search&amp;#039;（初始值必须是正整数）&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>zhwp&gt;Xiplus-abot</name></author>
	</entry>
</feed>