static void realPrecision(Args _args)
{
int i,j;
real a,b;
for (i=1;i<=3;i++)
{
a = exp10(i) - 1;
b = exp10(i) - 1;
for (j=1;j<=16;j++)
{
a += (9 / exp10(j));
b += (9 / exp10(j));
print strfmt("(%1) a = %2", num2str(j,2,0,0,0),num2str(a,25,16,1,1));
print strfmt("(%1) b = %2", num2str(j,2,0,0,0),num2str(b,25,16,1,1));
print strfmt("(%1) a + b = %2", num2str(j,2,0,0,0),num2str(a+b,25,16,1,1));
if (j mod 4 == 0)
pause;
}
}
}
No comments:
Post a Comment