Different results of the same caculation by loop code and by array code
for i=1:r
A=A+floor(sqrt(r^2-i^2));
end
—————
i=[1:r];
A=sum(floor(sqrt(r^2-i.^2)));
————————-
The same result by r=10^8
But the different results by r=10^9for i=1:r
A=A+floor(sqrt(r^2-i^2));
end
—————
i=[1:r];
A=sum(floor(sqrt(r^2-i.^2)));
————————-
The same result by r=10^8
But the different results by r=10^9 for i=1:r
A=A+floor(sqrt(r^2-i^2));
end
—————
i=[1:r];
A=sum(floor(sqrt(r^2-i.^2)));
————————-
The same result by r=10^8
But the different results by r=10^9 gaussian circle problem, for loop vs. array MATLAB Answers — New Questions