From: Matt Fig on
One approach:

>> A = -.1 + .4 -.1 + .1
A =
0.3
>> B = .3
B =
0.3
>> A==B
ans =
0
>> tol = 1e-10; % Define a tolerence
>> abs(A-B)<tol
ans =
1