sub floor(n) return int(n + .5) end sub sub binarySearch(list(), value) local low, high, mid low = 1 : high = arraysize(list(), 1) while(low <= high) mid = floor((low + high) / 2) if list(mid) > value then high = mid - 1 elsif list(mid) < value then low = mid + 1 else return mid end if wend return false end sub ITEMS = 10e6 dim list(ITEMS) for n = 1 to ITEMS list(n) = n next n print binarySearch(list(), 3) print peek("millisrunning")