UNPKG
bisect
Version:
latest (1.0.0)
1.0.0
0.0.0
Floating point binary search
github.com/mikolalysenko/bisect
mikolalysenko/bisect
bisect
/
test
/
test.js
10 lines
(7 loc)
•
187 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
var bisect =
require
(
"../bisect"
)
require
(
"tape"
)(
"testing"
,
function
(t)
{ t.
assert
(Math.
abs
(bisect(
function
(x)
{
return
x*x -
9
>
0
},
-10
,
10
,
1e-8
) -
3
) <
1e-8
) t.
end
() })