Unit testing for the Pearson Correlation Coefficient Testing.
The relative error should be as small as possible. Normally you should only have numerical errors. In your case the expected value has a limited number of digits which leads to a deviation from the calculated value. Try to reduce the error as much as possible.