repo.or.cz
/
williamcminus.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
finished 19 (not fully tested...)
[williamcminus.git]
/
assign6
/
while.txt
blob
f291728640ff2d5c1d4e8b73f2eaae0bb216dfe5
1
BEGIN {Calculate the square root of 2 using Newton's method.}
2
number := 2;
3
root := number;
4
5
WHILE root*root - number > 0.000001 DO BEGIN
6
root := (number/root + root)/2
7
END
8
END.