I am comparing the elements of the two vectors. Locally the comparison is successful. But when I am doing the same in the server, the result is that the vectors are not matched.
Is it a problem with gcc version? In my local system, the gcc version is [ gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 ] Whereas in the server its gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23). Can anyone let me know how to compare the vectors in this situation? Is there any other way of comparing the elements of vectors? Here the code:
#include <iostream>
#include <vector>
using namespace std;
int main() {
std::vector<double> v1 = {2.31858, 1.04694, 1.19577};
std::vector<double> v2 = {1.04694, 1.19577, 2.31858};
if(v2[0] == v1[1]) {
cout << "The vectors are matched.."<< endl;
} else {
cout << "The vectors are not matched.."<< endl;
}
}