Could anyone tell me how Vector.equals() checks the entries? Is there any precision tolerance for doubles?

I have a problem here:
A, B are Vector of doubles, for the code:
assertTrue(A.toString().equals(B.toString()));
assertTrue(A.equals(B));
I got True for the first line but False for the second.

Note that the numerical values must have exactly the same binary representations in memory for this to work. The equality check method is essentially an override of

1

2

3

<br/>

Object.equals(Objectobj)<br/>

To allow a precision parameter in the “equality” checking, which is most often the case in numerical computing, you may do:

Check the equality of two matrices. Two matrices are equal iff
1.the dimensions are the same;
2.all entries are equal
Parameters:
A1 – a matrix
A2 – a matrix
epsilon – a precision parameter: when a number |x| ≤ ε, it is considered 0
Returns:
true iff all entries are equal, entry by entry