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

17 lines
146 B
Plaintext

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