mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Fixed bug with incorrect LU decomposition (#2261)
* Fixed Bug #2257 * = Co-authored-by: Svn-Sp <svn-sp@email> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
@ -27,7 +27,7 @@ def newton(function: RealFunc, derivative: RealFunc, starting_int: int,) -> floa
|
||||
...
|
||||
ZeroDivisionError: Could not find root
|
||||
"""
|
||||
prev_guess float(starting_int)
|
||||
prev_guess = float(starting_int)
|
||||
while True:
|
||||
try:
|
||||
next_guess = prev_guess - function(prev_guess) / derivative(prev_guess)
|
||||
|
Reference in New Issue
Block a user