Diferente pentru blog/your-bisection-search-is-wrong intre reviziile #6 si #7
Nu exista diferente intre titluri.
Diferente intre continut:
Let's fix it: == code(python) |
def _cubicRootABS(c):
def _cubicRoot(c):
lo, hi = 0.0, max(1, c)
while lo * lo * lo != c:
return lo
def cubicRootABS(c):
def cubicRoot(c):
if c < 0:
return -_cubicRootABS(-c)
return -_cubicRoot(-c)
else:
return _cubicRootABS(c)
==
