RosettaCodeData/Task/Arithmetic-geometric-mean/Commodore-BASIC/arithmetic-geometric-mean.basic

11 lines
133 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
10 A = 1
20 G = 1/SQR(2)
30 GOSUB 100
40 PRINT A
50 END
100 TA = A
110 A = (A+G)/2
120 G = SQR(TA*G)
130 IF A<TA THEN 100
140 RETURN