I am having a bit of trouble understanding how the precision of these doubles affects the outcome of arithmetic operations in Matlab. I thought that since both a & b are doubles they would be able to carry out operations up to that precision. I realize there can be round-off error but since these numbers are well within the 64-bit number representation I didn't think that would be an issue.
a = 1.22e-45
b = 1
a == 0
ans = 0 %a is not equal to zero
(a + b) == 1
ans = 1
How come it is able to carry enough precision to recognize a != 0 but when added to 1 it doesn't show any change.