RosettaCodeData/Task/Arithmetic-geometric-mean/Logo/arithmetic-geometric-mean.logo
Ingy döt Net 6f050a029e update
2013-06-05 21:47:54 +00:00

9 lines
209 B
Text

to about :a :b
output and [:a - :b < 1e-15] [:a - :b > -1e-15]
end
to agm :arith :geom
if about :arith :geom [output :arith]
output agm (:arith + :geom)/2 sqrt (:arith * :geom)
end
show agm 1 1/sqrt 2