summaryrefslogtreecommitdiff
path: root/260/CH1/EX1.7/1_7.sce
blob: 80b252510d3f9badadd6020e068f23be9cc748e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//Eg-1.7
//pg-19

clear
clc


F(1)=1;
F(2)=1;
eps=10^(-12);
err=100;
i=1;
while err>=eps
    F(i+2)=F(i+1)+F(i);
    err=abs((F(i+1)/F(i+2)-(F(i)/F(i+1))));
    i=i+1;
    end
goldenratio=F(i)/F(i+1);
disp(goldenratio)