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