mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 02:18:39 +00:00
Update newton_raphson.py
This commit is contained in:
parent
8d6f837303
commit
cbaeaa035c
@ -21,7 +21,8 @@ def newton_raphson(
|
|||||||
>>> newton_raphson("log(x)- 1", 2)
|
>>> newton_raphson("log(x)- 1", 2)
|
||||||
2.718281828458938
|
2.718281828458938
|
||||||
>>> from scipy.optimize import newton
|
>>> from scipy.optimize import newton
|
||||||
>>> all(newton_raphson("log(x)- 1", 2) == newton("log(x)- 1", 2) for precision in 10, 100, 1000, 10000))
|
>>> all(newton_raphson("log(x)- 1", 2) == newton("log(x)- 1", 2)
|
||||||
|
... for precision in 10, 100, 1000, 10000))
|
||||||
True
|
True
|
||||||
>>> newton_raphson("log(x)- 1", 2, 0)
|
>>> newton_raphson("log(x)- 1", 2, 0)
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user