Demo entry 6344843

Cube Root Iterator


Submitted by Thomas Boudreaux on Jan 25, 2017 at 20:21
Language: Python. Code size: 147 Bytes.

# cube root calculator
def CubeItr(x0, v, i):
    x = x0
    for j in range(i):
        x = (x+v/(x**2))/2
    return x
CubeItr(3.0, 8.0, 10)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).