MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / equation

Function equation

maths/numerical_analysis/bisection_2.py:11–24  ·  view source on GitHub ↗

>>> equation(5) -15 >>> equation(0) 10 >>> equation(-5) -15 >>> equation(0.1) 9.99 >>> equation(-0.1) 9.99

(x: float)

Source from the content-addressed store, hash-verified

9
10
11def equation(x: float) -> float:
12 """
13 >>> equation(5)
14 -15
15 >>> equation(0)
16 10
17 >>> equation(-5)
18 -15
19 >>> equation(0.1)
20 9.99
21 >>> equation(-0.1)
22 9.99
23 """
24 return 10 - x * x
25
26
27def bisection(a: float, b: float) -> float:

Callers 1

bisectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected