mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-03-14 19:19:47 +01:00
add lo, hi params
This commit is contained in:
parent
de97253d92
commit
dce855611c
@ -10,10 +10,10 @@
|
||||
|
||||
use <_impl/_binary_search_impl.scad>;
|
||||
|
||||
function binary_search(sorted, target) =
|
||||
function binary_search(sorted, target, lo = 0, hi = undef) =
|
||||
_binary_search_impl(
|
||||
sorted,
|
||||
is_function(target) ? target : function(elem) elem == target ? 0 : elem > target ? 1 : -1,
|
||||
0,
|
||||
len(sorted) - 1
|
||||
lo,
|
||||
is_undef(hi) ? len(sorted) - 1 : hi
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user