> for j=1,20 do
>> a=1;b=2;for i=1,j do a=a+b;a,b=b,a;end print(a/b)
>> end
0.66666666666667
0.6
0.625
0.61538461538462
0.61904761904762
0.61764705882353
0.61818181818182
0.61797752808989
0.61805555555556
0.61802575107296
0.61803713527851
0.61803278688525
0.61803444782168
0.61803381340013
0.61803405572755
0.61803396316671
0.6180339985218
0.61803398501736
0.6180339901756
0.61803398820533
>
测试了从1到20次的迭代操作,发现这个数列其实很快就像0.618收敛了,其实0.618是不准确的,这个数字其实是个无理数 |
而黄金分割点的准确值是: > =(5^0.5-1)/2 0.61803398874989