
How to judge whether two whatever is equal? alphat and alpha are two kind big vectors. Why it turns 0, which means they are not equal?

How to judge whether two whatever is equal? alphat and alpha are two kind big vectors. Why it turns 0, which means they are not equal?
Copyright © 2021 JogjaFile Inc.
Floating point numbers are notoriously difficult to compare with
eq(),==or any other direct bitwise comparison. This is because finite precision arithmetic rarely allows us to compute exact values. If two different algorithms compute the same result differently, it is nearly guaranteed that the numerical result will differ by some small amount.Your best bet is to do an "almost equals" comparison: