I have two float[]
objects. Without writing a for-loop, I want to compare my two 1D arrays to see if they are equal numerically or not.
When I run the following code (as all elements are equal), it doesn't go through the if-statement and show the message.
How should I apply the Equals command to work properly?
Is there any compare-command I could use?
Random r1 = new Random(1);
int rndNumber= r1.Next(10);
float[] m = Enumerable.Repeat((float)rndNumber, 180).ToArray();
float[] m2 = Enumerable.Repeat((float)rndNumber, 180).ToArray();
if (m.Equals(m2))
{
MessageBox.Show("we are equal");
}