That's because two real numbers that are a bit different might display exactly the same. So you may think they are equal, but in fact internally they are not. All depends on the precision.used and this is not a DS feature but common to all software products.
As said before, you are not comparing reals but character strings. So that behavior does not apply to your data flow. By casting to a decimal you are removing extraneous blanks.