So I found this small problem.
>> p1
p1 =
0.0050
>> p2
p2 =
0.0450
>> p1+p2 - 0.05
ans =
-6.9389e-18
Obviously p1 + p2 is 0.05 but I think due to float problem when summed the result is not exactly equal to 0.05. Is there a way to restore p1+p2 back to 0.05? Thanks in advance. (above code is only for reference. It is not the goal of the question)