blob: 8fb15d18d04691ad2c3204fa7f5d8c2ba7d49f5d (
plain)
1
2
3
4
5
6
7
8
|
// Example 3.6
//Program using a cast to evaluate the equation.
sum1=0;
for n=int8(1:10)
sum1=sum1+1/double(n); //conversion from 'int' to 'double' or 'float'
printf("%2d %6.4f\n",n,sum1);
end
|