Module:Exponential search:修订间差异

小 已更改“Module:Exponential search”的保护设置:​高風險模板:121389引用<!-- 機器人3 -->​([编辑=仅允许管理员](无限期)​[移动=仅允许管理员](无限期))
 
Lhscogs​(留言 | 贡献)
小 导入1个版本
 
(未显示2个用户的2个中间版本)
第1行: 第1行:
-- This module provides a generic exponential search algorithm.
-- This module provides a generic exponential search algorithm.
require[[strict]]


local checkType = require('libraryUtil').checkType
local checkType = require('libraryUtil').checkType
第32行: 第33行:
if init and (init < 1 or init ~= floor(init) or init == math.huge) then
if init and (init < 1 or init ~= floor(init) or init == math.huge) then
error(string.format(
error(string.format(
"无效的初始值 '%s' 在参数 #2 中检测到" ..
"invalid init value '%s' detected in argument #2 to " ..
"'Exponential search'(初始值必须是正整数)",
"'Exponential search' (init value must be a positive integer)",
tostring(init)
tostring(init)
), 2)
), 2)