Wednesday, March 2, 2011

Mar. 2

Sorry I messed up on writing Newton's algorithm, the program is:

>>> def sqrt(n):
...     approx = n/2.0
...     better = (approx + n/approx)/2.0
...     while better != approx:
...         approx = better
...         better = (approx + n/approx)/2.0
...     return approx
...
These are the questions for chapter 6


No comments:

Post a Comment