The for loop gives an odd number instead of 0?
Show older comments
Hello, I have a easy question but it is making me crazy.I have a for loop as follow:
zr4=1.1;zr2=-0.1;
KK=0.1;
for LL=1:DD
zr2=zr2+KK;
zr4=zr4-KK;
.......
end
When I see the result, Zr4 is changing from 1 to 1.3878e-16. I am so confused. after 0.1 instead of giving 0, it gives 1.3878e-16. I appreciate if you help me. Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!