Module:Exponential search:修订间差异
小 导入1个版本 |
[IPE-NEXT] Quick edit imported from w:en:Module:Exponential search |
||
| 第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( | ||
" | "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) | ||