01 REM     The GNU Square Root Demo.
02 REM     Copyright (C) Sandul Yura Valentinovich.
03 REM     (R) Wednesday, 5 March 2003 year.
04 REM     This program is free software; you can redistribute it and/or modify
05 REM it under the terms of the GNU General Public License as published by the
06 REM Free Software Foundation; either version 2 of the License, or (at your
07 REM option) any later version.
08 REM     This program is distributed in the hope that it will be useful, but
09 REM WITHOUT ANY WARRANTY; without even the implied warranty of
10 REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11 REM Public License for more details.
12 REM     You should have received a copy of the GNU General Public License
13 REM along with this program; if not, write to the Free Software Foundation,
14 REM Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15 REM
16 DIM NUMBER$
17 DIM MEANING#
18 DIM VALUE#
19 DIM CONTROLVALUE#
20 PRINT "    The GNU Square Root Demo."
21 PRINT "    Copyright (C) Sandul Yura Valentinovich."
22 PRINT "    (R) Wednesday, 5 March 2003 year."
23 PRINT "    This program is free software; you can redistribute it and/or modify it"
24 PRINT "under the terms of the GNU General Public License as published by the Free"
25 PRINT "Software Foundation; either version 2 of the License, or (at your option) any"
26 PRINT "later version."
27 PRINT "    This program is distributed in the hope that it will be useful, but WITHOUT"
28 PRINT "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS"
29 PRINT "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details."
30 PRINT "    You should have received a copy of the GNU General Public License along with"
31 PRINT "this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave,"
32 PRINT "Cambridge, MA 02139, USA."
33 PRINT
34 LINE INPUT "Enter number (empty to quit)=";NUMBER$
35 IF NUMBER$="" THEN END
36 LET MEANING#=VAL(NUMBER$)
37 LET VALUE#=1
38 LET CONTROLVALUE#=0
39 WHILE VALUE#<>CONTROLVALUE#
40 LET CONTROLVALUE#=VALUE#
41 LET VALUE#=((MEANING#/VALUE#)+VALUE#)/2
42 WEND
43 PRINT "Square root for "+NUMBER$+" is:"
44 PRINT VALUE#
45 PRINT
