RosettaCodeData/Task/Binary-search/Axe/binary-search.axe

17 lines
146 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
Lbl BSEARCH
0→L
r₃-1→H
While L≤H
(L+H)/2→M
If {L+M}>r₂
M-1→H
ElseIf {L+M}<r₂
M+1→L
Else
M
Return
End
End
-1
Return