blob: 12404e51a36d0d3e06a76a27d4166553d92c9087 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// example 5-6 in page 133
clc;
//Given data
//error should be less thsn 1%
// for less than 1% error count>=100
n=6;
N=0;
while(N<100)
N=(2^n)-1;//count value
if(N<100)
n=n+1;//increment n and check weather N has exceeded 100
end
end
printf("for less 1percent error,use n=%d\n",n);
//end
// for less 1percent error,use n=7
|