I want to find pi in MATLAB and when I do compare it with the pi that is already embodied in MATLAB. So when I write
while(p~=pi)
the loop seems endless because it keeps testing for all the digits that the MATLAB pi has.
So when I wrote:
p=3.1416;
if p==pi
disp('yes');
else
disp('no');
end
the answer naturally was no. So I want to find a way to keep only five digits after the point and test with that, test for pi=3.14159.
Can anyone help?