Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/TheAlgorithms/JavaScript
/ BisectionMethod.test.js
File
BisectionMethod.test.js
Maths/test/BisectionMethod.test.js:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
import
{ findRoot } from
'../BisectionMethod'
2
3
test(
'Equation f(x) = x^2 - 3*x + 2 = 0, has root x = 1 in [a, b] = [0, 1.5]'
, () => {
4
const
root = findRoot(0, 1.5, (x) => x ** 2 - 3 * x + 2, 8)
Callers
nothing calls this directly
Calls
2
findRoot
Function · 0.90
log
Method · 0.45
Tested by
no test coverage detected